sandmark.util.controlflowgraph
Class Graph
java.lang.Object
|
+--sandmark.util.controlflowgraph.Graph
- Direct Known Subclasses:
- MethodCFG, RegisterAllocator.IGGraph
- public class Graph
- extends java.lang.Object
Constructor Summary |
Graph()
Constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
rootEdgeModCount
protected int rootEdgeModCount
revRootEdgeModCount
protected int revRootEdgeModCount
nodeModCount
protected int nodeModCount
edgeModCount
protected int edgeModCount
removingNode
protected int removingNode
removingEdge
protected int removingEdge
Graph
public Graph()
- Constructor.
graph
public Graph graph()
- Converts the graph to a
sandmark.util.graph.Graph
.
- Returns:
- the converted graph
shouldIncludeInGraph
boolean shouldIncludeInGraph(GraphNode gn)
roots
public java.util.ArrayList roots()
- Returns:
- The nodes in the graph that do not have predecessors.
reverseRoots
public java.util.ArrayList reverseRoots()
- Returns:
- The nodes in the graph that do not have successors.
buildRootList
public void buildRootList(java.util.ArrayList nl,
boolean reverse)
getSuccs
public java.util.ArrayList getSuccs(GraphNode v)
getPreds
public java.util.ArrayList getPreds(GraphNode v)
getPreOrderIndex
public int getPreOrderIndex(GraphNode node)
getPostOrderIndex
public int getPostOrderIndex(GraphNode node)
getPreOrder
public java.util.ArrayList getPreOrder()
getPostOrder
public java.util.ArrayList getPostOrder()
removeUnreachable
public void removeUnreachable()
addNode
public void addNode(GraphNode node)
removeNode
public void removeNode(GraphNode node)
addEdge
public void addEdge(GraphNode v,
GraphNode w)
removeEdge
public void removeEdge(GraphNode v,
GraphNode w)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hasNode
public boolean hasNode(GraphNode node)
hasEdge
public boolean hasEdge(GraphNode v,
GraphNode w)
nodes
public java.util.ArrayList nodes()
size
public int size()
main
public static void main(java.lang.String[] argv)