sandmark.util.controlflowgraph
Class Graph
java.lang.Object
|
+--sandmark.util.controlflowgraph.Graph
- Direct Known Subclasses:
- MethodCFG
- 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.
roots
public Graph.NodeList roots()
- Returns:
- The nodes in the graph that do not have predecessors.
reverseRoots
public Graph.NodeList reverseRoots()
- Returns:
- The nodes in the graph that do not have successors.
buildRootList
public void buildRootList(Graph.NodeList 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 Graph.NodeList getPreOrder()
getPostOrder
public Graph.NodeList 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 Graph.NodeList nodes()
size
public int size()