public class HeapNode extends Object implements Serializable
| Constructor and Description |
|---|
HeapNode(Object node,
double priority)
Creates a HeapNode with a specified priority and encapsulating
an object.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
toString()
Returns a String representation of this HeapNode.
|
public HeapNode(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.public 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 ).
Copyright © 2019 JULIE Lab, Germany. All rights reserved.