SandMark version 3.0


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


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(java.util.ArrayList 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)
           
 Graph graph()
          Converts the graph to a sandmark.util.graph.Graph.
 boolean hasEdge(GraphNode v, GraphNode w)
           
 boolean hasNode(GraphNode node)
           
static void main(java.lang.String[] argv)
           
 java.util.ArrayList nodes()
           
 void removeEdge(GraphNode v, GraphNode w)
           
 void removeNode(GraphNode node)
           
 void removeUnreachable()
           
 java.util.ArrayList reverseRoots()
           
 java.util.ArrayList roots()
           
(package private)  boolean shouldIncludeInGraph(GraphNode gn)
           
 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

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)

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003