|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.util.HeapNode
public class HeapNode
A node in a Heap, encapsulating the actual object represented by the noode plus the priority of the node in the heap.
Field Summary | |
---|---|
(package private) java.lang.Object |
node
The actual object encapsulated by the HeapNode. |
(package private) double |
priority
The priority of the HeapNode |
Constructor Summary | |
---|---|
HeapNode(java.lang.Object node,
double priority)
Creates a HeapNode with a specified priority and encapsulating an object. |
Method Summary | |
---|---|
java.lang.Object |
getObject()
Returns the object encapsultaed by this HeapNode. |
double |
getPriority()
Returns the priority of the HeapNode within the Heap. |
void |
setPriority(double priority)
Modifies the priority of the HeapNode within the Heap. |
java.lang.String |
toString()
Returns a String representation of this HeapNode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.lang.Object node
double priority
Constructor Detail |
---|
public HeapNode(java.lang.Object node, double priority)
priority
- The priority of the node in the heap, determining the
position of the node within the heap.node
- The actual Object encapsulated by the node.Method Detail |
---|
public java.lang.Object getObject()
public double getPriority()
public void setPriority(double priority)
This method simply sets the priority attribute of the node. This will not necessarily fixup the Heap such that this HeapNode will be in its new position. To achieve that effect, call Heap.setPriority( HeapNode ).
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |