org.gcn.plinguacore.util
Class IndexedPriorityQueue.Node<T extends E>
java.lang.Object
org.gcn.plinguacore.util.IndexedPriorityQueue.Node<T>
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<IndexedPriorityQueue.Node<T>>
- Enclosing class:
- IndexedPriorityQueue<E extends java.lang.Comparable<E>>
public class IndexedPriorityQueue.Node<T extends E>
- extends java.lang.Object
- implements java.lang.Comparable<IndexedPriorityQueue.Node<T>>, java.io.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
IndexedPriorityQueue.Node
public IndexedPriorityQueue.Node(int i,
T value)
- Parameters:
i
- value
-
compareTo
public int compareTo(IndexedPriorityQueue.Node<T> o)
- Specified by:
compareTo
in interface java.lang.Comparable<IndexedPriorityQueue.Node<T extends E>>
parent
public IndexedPriorityQueue.Node<T> parent()
- Returns:
- The parent of this node, null in the case of the root
setParent
public void setParent(IndexedPriorityQueue.Node<T> parent)
- Parameters:
parent
- the parent to set
i
public int i()
- Returns:
- the i
setI
public void setI(int i)
- Parameters:
i
- the i to set
value
public E value()
- Returns:
- the t_i held by this node (i,t_i)
setValue
public void setValue(T value)
- Parameters:
value
- Value for this node, t_i
setRightChild
public void setRightChild(IndexedPriorityQueue.Node<T> rightChild)
- Parameters:
rightChild
- the rightChild to set
setLeftChild
public void setLeftChild(IndexedPriorityQueue.Node<T> leftChild)
- Parameters:
leftChild
- the leftChild to set
getRightChild
public IndexedPriorityQueue.Node<T> getRightChild()
- Returns:
- the right child of this node
getLeftChild
public IndexedPriorityQueue.Node<T> getLeftChild()
- Returns:
- the left child of this node
minimumValue
public E minimumValue()
- Returns:
- Minimum value held by the children of this node
minimumChild
public IndexedPriorityQueue.Node<T> minimumChild()
- Returns:
- The child that holds the minimum value
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
treeRepresentation
public java.lang.String treeRepresentation(int deep)