|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.util.Stack<GraphNode>
org.jikesrvm.compilers.opt.util.DFSenumerateByFinish
public class DFSenumerateByFinish
This class implements depth-first search over a Graph, return an enumeration of the nodes of the graph in order of increasing finishing time. This class follows the outNodes of the graph nodes to define the graph, but this behavior can be changed by overriding the getConnected method.
| Field Summary | |
|---|---|
GraphNode |
currentRoot
While a depth-first enumeration is in progress, this field holds the current root node, i.e. the current botton of the search stack (assuming stacks grow upward). |
private GraphNodeEnumeration |
e
an enumeration of all nodes to search from |
private GraphNodeEnumeration[] |
info
an enumeration of child nodes for each node being searched |
private GraphNode |
theNextElement
the current next element in finishing time order |
| Constructor Summary | |
|---|---|
protected |
DFSenumerateByFinish(Graph net)
Construct a depth-first enumerator across all the nodes of a graph. |
|
DFSenumerateByFinish(Graph net,
GraphNodeEnumeration nodes)
Construct a depth-first enumerator across the (possibly improper) subset of nodes reachable from the nodes in the given enumeration. |
| Method Summary | |
|---|---|
protected GraphNodeEnumeration |
getConnected(GraphNode n)
get the out edges of a given node |
boolean |
hasMoreElements()
Return whether there are any more nodes left to enumerate. |
GraphNode |
next()
Find the next graph node in finishing time order. |
GraphNode |
nextElement()
Wrapper for next() to make the Enumeration interface happy |
| Methods inherited from class org.jikesrvm.compilers.opt.util.Stack |
|---|
compare, copy, empty, getTOS, isEmpty, iterator, peek, pop, push, shallowCopy, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public GraphNode currentRoot
private GraphNode theNextElement
private final GraphNodeEnumeration e
private final GraphNodeEnumeration[] info
| Constructor Detail |
|---|
protected DFSenumerateByFinish(Graph net)
net - the graph whose nodes to enumerate
public DFSenumerateByFinish(Graph net,
GraphNodeEnumeration nodes)
net - the graph whose nodes to enumeratenodes - the set of nodes from which to start searching| Method Detail |
|---|
public boolean hasMoreElements()
hasMoreElements in interface Enumeration<GraphNode>public GraphNode next()
next in interface GraphNodeEnumerationnextElement()public GraphNode nextElement()
nextElement in interface Enumeration<GraphNode>next()protected GraphNodeEnumeration getConnected(GraphNode n)
n - the node of which to get the out edges
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||