|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.Prim.PrimInfo
Inner class to maintain the Vertex
object, key,
parent, and handle into the priority queue for each vertex.
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. |
java.lang.Double |
key
Vertex's key, representing the weight of the lightest edge between this vertex and some vertex known to be in the minimum spanning tree. |
com.mhhe.clrs2e.Vertex |
pi
The current parent for this vertex. |
com.mhhe.clrs2e.Vertex |
theVertex
The vertex. |
Constructor Summary | |
Prim.PrimInfo(com.mhhe.clrs2e.Vertex v,
com.mhhe.clrs2e.MinPriorityQueue q)
Sets the instance variables so that there is no known edge between this vertex and any vertex in the minimum spanning tree (i.e., the key is infinity), and inserts this object into the min-priority queue. |
Method Summary | |
int |
compareTo(java.lang.Object e)
Compares this object's key to that of another PrimInfo object. |
java.lang.Comparable |
getKey()
Returns the value of the key. |
void |
setKey(java.lang.Comparable key)
Sets the key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public com.mhhe.clrs2e.Vertex theVertex
public java.lang.Double key
public com.mhhe.clrs2e.Vertex pi
public java.lang.Object handle
null
if the vertex is not in the
priority queue.
Constructor Detail |
public Prim.PrimInfo(com.mhhe.clrs2e.Vertex v, com.mhhe.clrs2e.MinPriorityQueue q)
v
- The vertex.q
- The min-priority queue.Method Detail |
public void setKey(java.lang.Comparable key)
setKey
in interface DynamicSetElement
key
- The new key value.public java.lang.Comparable getKey()
getKey
in interface DynamicSetElement
public int compareTo(java.lang.Object e)
PrimInfo
object.
compareTo
in interface DynamicSetElement
e
- The other PrimInfo
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |