SandMark version 2.0


sandmark.util.controlflowgraph
Class Graph

java.lang.Object
  |
  +--sandmark.util.controlflowgraph.Graph
Direct Known Subclasses:
MethodCFG

public class Graph
extends java.lang.Object


Nested Class Summary
(package private)  class Graph.EdgeSet
           
 class Graph.NodeList
           
 
Field Summary
protected  int edgeModCount
           
protected  int nodeModCount
           
protected  int removingEdge
           
protected  int removingNode
           
protected  int revRootEdgeModCount
           
protected  int rootEdgeModCount
           
 
Constructor Summary
Graph()
          Constructor.
 
Method Summary
 void addEdge(GraphNode v, GraphNode w)
           
 void addNode(GraphNode node)
           
 void buildRootList(Graph.NodeList nl, boolean reverse)
           
 Graph.NodeList getPostOrder()
           
 int getPostOrderIndex(GraphNode node)
           
 java.util.ArrayList getPreds(GraphNode v)
           
 Graph.NodeList getPreOrder()
           
 int getPreOrderIndex(GraphNode node)
           
 java.util.ArrayList getSuccs(GraphNode v)
           
 boolean hasEdge(GraphNode v, GraphNode w)
           
 boolean hasNode(GraphNode node)
           
 Graph.NodeList nodes()
           
 void removeEdge(GraphNode v, GraphNode w)
           
 void removeNode(GraphNode node)
           
 void removeUnreachable()
           
 Graph.NodeList reverseRoots()
           
 Graph.NodeList roots()
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootEdgeModCount

protected int rootEdgeModCount

revRootEdgeModCount

protected int revRootEdgeModCount

nodeModCount

protected int nodeModCount

edgeModCount

protected int edgeModCount

removingNode

protected int removingNode

removingEdge

protected int removingEdge
Constructor Detail

Graph

public Graph()
Constructor.

Method Detail

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()

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002