|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 bottom of the search stack (assuming stacks grow upward). |
private Enumeration<GraphNode> |
e
an enumeration of all nodes to search from |
private List<Enumeration<GraphNode>> |
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,
Enumeration<GraphNode> nodes)
Construct a depth-first enumerator across the (possibly improper) subset of nodes reachable from the nodes in the given enumeration. |
Method Summary | |
---|---|
protected Enumeration<GraphNode> |
getConnected(GraphNode n)
get the out edges of a given node |
boolean |
hasMoreElements()
Return whether there are any more nodes left to enumerate. |
GraphNode |
nextElement()
Find the next graph node in finishing time order. |
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 Enumeration<GraphNode> e
private final List<Enumeration<GraphNode>> info
Constructor Detail |
---|
protected DFSenumerateByFinish(Graph net)
net
- the graph whose nodes to enumeratepublic DFSenumerateByFinish(Graph net, Enumeration<GraphNode> nodes)
net
- the graph whose nodes to enumeratenodes
- the set of nodes from which to start searchingMethod Detail |
---|
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration<GraphNode>
public GraphNode nextElement()
nextElement
in interface Enumeration<GraphNode>
nextElement()
protected Enumeration<GraphNode> 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 |