SandMark version 2.1


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


Nested Class Summary
(package private)  class Graph.EdgeSet
           
(package private)  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)
           
 java.util.ArrayList getPostOrder()
           
 int getPostOrderIndex(GraphNode node)
           
 java.util.ArrayList getPreds(GraphNode v)
           
 java.util.ArrayList getPreOrder()
           
 int getPreOrderIndex(GraphNode node)
           
 java.util.ArrayList getSuccs(GraphNode v)
           
 boolean hasEdge(GraphNode v, GraphNode w)
           
 boolean hasNode(GraphNode node)
           
 java.util.ArrayList nodes()
           
 void removeEdge(GraphNode v, GraphNode w)
           
 void removeNode(GraphNode node)
           
 void removeUnreachable()
           
 java.util.ArrayList reverseRoots()
           
 java.util.ArrayList 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 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(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 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()

SandMark version 2.1

Wed Jul 3 17:27:43 MST 2002