JML

org.multijava.util.jperf
Class Graph

java.lang.Object
  extended byorg.multijava.util.jperf.Graph

class Graph
extends Object

This class represents the intermediate graph


Field Summary
private  long maxNodeValue
           
private  ArrayList nodes
           
 
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(PrintWriter out)
          Outputs g-values.
 void init()
          Initialises the internal structures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxNodeValue

private final long maxNodeValue

nodes

private ArrayList nodes
Constructor Detail

Graph

public Graph(long maxNodeValue)
Constructs a new graph object

Method Detail

init

public void init()
Initialises 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 otherwise.

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(PrintWriter out)
Outputs g-values.

Parameters:
out - the output stream.

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.