de.upb.swtpra05.group03.shuttle
Class DijkstraNode

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.DijkstraNode
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
GraphNode

public class DijkstraNode
extends java.lang.Object
implements java.lang.Comparable

Represents nodes of any graph which are useable with dijkstra

Version:
$Revision: 1.3 $

Field Summary
protected  java.util.HashSet edges
          Collection which contains all outgoing edges of this node
protected  int id
          The id of the node
protected  int shortestPathPredecessor
          The index of the predecessor of this node on the shortest path to the source of a spanning tree in the underlying datastructure
protected  long stretch
          The max weight value by which this node can be reached over edges
 
Constructor Summary
DijkstraNode(int id)
          Constructor for class DijkstraNode
DijkstraNode(int id, long s, int indexOfSpp)
          Constructor for class DijkstraNode
 
Method Summary
 void addDijkstraEdge(DijkstraEdge e)
          Adds an edge to the outgoing edges of this node
 int compareTo(java.lang.Object o)
          Method of the Comparable interface which compares two dijkstra nodes
 java.lang.String toString()
          Returns a string value containing a description of this instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stretch

protected long stretch
The max weight value by which this node can be reached over edges


edges

protected final java.util.HashSet edges
Collection which contains all outgoing edges of this node


shortestPathPredecessor

protected int shortestPathPredecessor
The index of the predecessor of this node on the shortest path to the source of a spanning tree in the underlying datastructure


id

protected final int id
The id of the node

Constructor Detail

DijkstraNode

public DijkstraNode(int id)
Constructor for class DijkstraNode

Parameters:
id - The id of the node

DijkstraNode

public DijkstraNode(int id,
                    long s,
                    int indexOfSpp)
Constructor for class DijkstraNode

Parameters:
s - The weight value
id - The id value
indexOfSpp - Description of the Parameter
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Method of the Comparable interface which compares two dijkstra nodes

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - Object containing a dijkstra nod to compare this instance with
Returns:
Returns -1 if the weight of this node is smaller than the weight of the given object, 0 if its the same or +1 else

addDijkstraEdge

public void addDijkstraEdge(DijkstraEdge e)
Adds an edge to the outgoing edges of this node

Parameters:
e - The edge to be added.

toString

public java.lang.String toString()
Returns a string value containing a description of this instance

Returns:
A string containing a description of this instance