nz.ac.waikato.mcennis.rat.graph.path
Class PathNode

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.path.PathNode

public class PathNode
extends java.lang.Object

Class for implementing Djikstra's Spanning Tree algorithm.


Constructor Summary
PathNode()
          Creates a new instance of PathNode
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares two PathNodes.
 Actor getActor()
          Returns the Actor associated with this PathNode.
 double getCost()
          Return the total cost to the root of the spanning tree
 int getId()
          Returns the id associated with this group of PathNodes
 PathNode getPrevious()
          Return the previous PathNode in this implicit Path.
 Link getPreviousLink()
           
 void setActor(Actor a)
          Set the actor that this PathNode represents.
 void setCost(double c)
          Set the cost to the spanning tree root
 void setId(int i)
          Set the id for this node
 void setPrevious(PathNode p)
          Set the previous PathNode in the spanning tree implicitly defined by this set of PathNodes.
 void setPreviousLink(Link l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathNode

public PathNode()
Creates a new instance of PathNode

Method Detail

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares two PathNodes.
  1. If ids are different, return the difference
  2. Return the result of comparing the underlying actors.
  3. Return differences in the underlying cost

Parameters:
o - object to be compared against
Returns:
ordering of the PathNode
Throws:
java.lang.ClassCastException

getId

public int getId()
Returns the id associated with this group of PathNodes

Returns:
id of the node

setId

public void setId(int i)
Set the id for this node

Parameters:
i - new node ID

setActor

public void setActor(Actor a)
Set the actor that this PathNode represents.

Parameters:
a - actor associated with this PathNode

getActor

public Actor getActor()
Returns the Actor associated with this PathNode. Returns null if none has been set.

Returns:
associated actor

setPrevious

public void setPrevious(PathNode p)
Set the previous PathNode in the spanning tree implicitly defined by this set of PathNodes. Returns null if no such PathNode is defined

Parameters:
p - previous PathNode in this implicit Path

getPrevious

public PathNode getPrevious()
Return the previous PathNode in this implicit Path.

Returns:
previous PathNode in the spanning tree

getCost

public double getCost()
Return the total cost to the root of the spanning tree

Returns:
total cost to the root of the spanning tree

setCost

public void setCost(double c)
Set the cost to the spanning tree root

Parameters:
c - new cost to the spanning tree root

setPreviousLink

public void setPreviousLink(Link l)

getPreviousLink

public Link getPreviousLink()

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads