com.mhhe.clrs2e
Class Dijkstra.DijkstraInfo

java.lang.Object
  |
  +--com.mhhe.clrs2e.ShortestPathInfo
        |
        +--com.mhhe.clrs2e.Dijkstra.DijkstraInfo
All Implemented Interfaces:
java.lang.Comparable, DynamicSetElement
Enclosing class:
Dijkstra

private static class Dijkstra.DijkstraInfo
extends ShortestPathInfo
implements DynamicSetElement

Inner class to maintain the Vertex object, key, parent, and handle into the priority queue for each vertex. The key (shortest-path estimate) and parent are inherited from the superclass ShortestPathInfo.


Nested Class Summary
 
Nested classes inherited from class com.mhhe.clrs2e.DynamicSetElement
DynamicSetElement.Helper
 
Field Summary
 java.lang.Object handle
          A handle to the vertex's information in the priority queue, or null if the vertex is not in the priority queue.
 com.mhhe.clrs2e.Vertex theVertex
          The vertex.
 
Fields inherited from class com.mhhe.clrs2e.ShortestPathInfo
 
Constructor Summary
Dijkstra.DijkstraInfo()
          Creates a DijkstraInfo object.
 
Method Summary
 int compareTo(java.lang.Object e)
          Compares the key of this object's vertex to that of another.
 java.lang.Comparable getKey()
          Returns the value of the key.
 void setKey(java.lang.Comparable key)
          Sets the key.
 
Methods inherited from class com.mhhe.clrs2e.ShortestPathInfo
getEstimate, getPredecessor, relax, setEstimate, setPredecessor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theVertex

public com.mhhe.clrs2e.Vertex theVertex
The vertex.


handle

public java.lang.Object handle
A handle to the vertex's information in the priority queue, or null if the vertex is not in the priority queue.

Constructor Detail

Dijkstra.DijkstraInfo

public Dijkstra.DijkstraInfo()
Creates a DijkstraInfo object. The instance variables theVertex and handle fields will have to be set by the caller.

Method Detail

setKey

public void setKey(java.lang.Comparable key)
Sets the key.

Specified by:
setKey in interface DynamicSetElement
Parameters:
key - The new key value.

getKey

public java.lang.Comparable getKey()
Returns the value of the key.

Specified by:
getKey in interface DynamicSetElement

compareTo

public int compareTo(java.lang.Object e)
Compares the key of this object's vertex to that of another.

Specified by:
compareTo in interface DynamicSetElement
Parameters:
e - The other DijkstraInfo object.
Returns:
A negative integer if the key of this object's vertex is less; 0 if the keys are equal; a positive integer if the key of this object's vertex is greater.