at.dms.jperf
Class Graph

java.lang.Object
  |
  +--at.dms.jperf.Graph

class Graph
extends java.lang.Object

This class represents the intermediate graph.


Constructor Summary
Graph(long maxNodeValue)
          Constructs a new graph object.
 
Method Summary
 boolean addEdge(long label1, long label2, long edge)
          Adds an edge (and the corresponding nodes if necessary) to the graph.
 void addNode(Node node)
          Adds a node to the graph.
 void assignGValues(int keywordCount)
          Sets g-values for all nodes.
 void clearVisited()
          Clears visited flags of all nodes.
 Node findNode(long label)
          Searches node with given label the intermediate graph.
 void genCode(java.io.PrintWriter out)
          Outputs g-values.
 void init()
          Initializes the internal structures.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph

public Graph(long maxNodeValue)
Constructs a new graph object.
Method Detail

init

public void init()
Initializes the internal structures.

addNode

public void addNode(Node node)
Adds a node to the graph.
Parameters:
node - the node to add.

findNode

public Node findNode(long label)
Searches node with given label the intermediate graph.
Parameters:
label - The node label.
Returns:
The node with given label, null if not found.

addEdge

public boolean addEdge(long label1,
                       long label2,
                       long edge)
Adds an edge (and the corresponding nodes if necessary) to the graph.
Parameters:
label1 - The label of the source node.
label2 - The label of the target node.
edge - The edge value.
Returns:
true iff the graph is still acyclic.

clearVisited

public void clearVisited()
Clears visited flags of all nodes.

assignGValues

public void assignGValues(int keywordCount)
Sets g-values for all nodes.

genCode

public void genCode(java.io.PrintWriter out)
Outputs g-values.
Parameters:
out - The output stream.