org.jikesrvm.compilers.opt.util
Class ReverseDFSenumerateByFinish

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.Stack<GraphNode>
      extended by org.jikesrvm.compilers.opt.util.DFSenumerateByFinish
          extended by org.jikesrvm.compilers.opt.util.ReverseDFSenumerateByFinish
All Implemented Interfaces:
Iterable<GraphNode>, Enumeration<GraphNode>
Direct Known Subclasses:
ReverseFilteredDFSenumerateByFinish

public class ReverseDFSenumerateByFinish
extends DFSenumerateByFinish

This class generates an enumeration of nodes of a graph, in order of increasing finishing time in a reverse Depth First Search, i.e. a search traversing nodes from target to source.


Field Summary
 
Fields inherited from class org.jikesrvm.compilers.opt.util.DFSenumerateByFinish
currentRoot
 
Constructor Summary
ReverseDFSenumerateByFinish(Graph net)
          Construct a reverse DFS across a graph.
ReverseDFSenumerateByFinish(Graph net, Enumeration<GraphNode> nodes)
          Construct a reverse DFS across a subset of a graph, starting at the given set of nodes.
 
Method Summary
protected  Enumeration<GraphNode> getConnected(GraphNode n)
          Traverse edges from target to source.
 
Methods inherited from class org.jikesrvm.compilers.opt.util.DFSenumerateByFinish
hasMoreElements, nextElement
 
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
 

Constructor Detail

ReverseDFSenumerateByFinish

public ReverseDFSenumerateByFinish(Graph net)
Construct a reverse DFS across a graph.

Parameters:
net - The graph over which to search.

ReverseDFSenumerateByFinish

public ReverseDFSenumerateByFinish(Graph net,
                                   Enumeration<GraphNode> nodes)
Construct a reverse DFS across a subset of a graph, starting at the given set of nodes.

Parameters:
net - The graph over which to search
nodes - The nodes at which to start the search
Method Detail

getConnected

protected Enumeration<GraphNode> getConnected(GraphNode n)
Traverse edges from target to source.

Overrides:
getConnected in class DFSenumerateByFinish
Parameters:
n - A node in the DFS
Returns:
The nodes that have edges leading to n