at.dms.jperf
Class Node

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

class Node
extends java.lang.Object

Node is an object class representing nodes in GGPerf's intermediate graph.


Constructor Summary
Node(long l)
          Creates a new node labelled as the argument in the intermediate graph.
 
Method Summary
 void addAdjacency(Node node, long edge)
          Add an adjacent node with its edge to the adjacency list of this node.
 void assignGValue(long val, int max)
          Recursively assigns g_value for all nodes that could be reached from this node.
 long getGValue()
          Return the G value of the node.
 long getLabel()
          Return the label of the node.
 boolean getVisited()
          Return the current status of the node.
 boolean reaches(Node target)
          Checks whether there is a path from this node to the target node.
 void setVisited(boolean b)
          During a cyclicity checking process, set the status to be the argument.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(long l)
Creates a new node labelled as the argument in the intermediate graph.
Parameters:
label - The label.
Method Detail

getLabel

public long getLabel()
Return the label of the node.
Returns:
The label as a long value.

getGValue

public long getGValue()
Return the G value of the node.
Returns:
The G value as a long value.

addAdjacency

public void addAdjacency(Node node,
                         long edge)
Add an adjacent node with its edge to the adjacency list of this node.
Parameters:
node - The adjacent node.
edge - The edge between this node and the adjacent node.

getVisited

public boolean getVisited()
Return the current status of the node.
Returns:
The status as a boolean value. True means having been visited.

setVisited

public void setVisited(boolean b)
During a cyclicity checking process, set the status to be the argument.
Parameters:
b - The status. True mean having been visited.

reaches

public boolean reaches(Node target)
Checks whether there is a path from this node to the target node. Uses Depth First Search and marks visited nodes on the path
Parameters:
target - The target node.
Returns:
true iff the target node is reachable.

assignGValue

public void assignGValue(long val,
                         int max)
Recursively assigns g_value for all nodes that could be reached from this node.
Parameters:
val - the value to assign to this node.
max - the maximum value (= # of keywords).