java.lang.Object
org.cicirello.ds.PriorityQueueNode<E>
org.cicirello.ds.PriorityQueueNode.Integer<E>
- Type Parameters:
E- The type of element contained in the PriorityQueueNode.
- All Implemented Interfaces:
Copyable<PriorityQueueNode.Integer<E>>
- Enclosing class:
- PriorityQueueNode<E>
public static final class PriorityQueueNode.Integer<E>
extends PriorityQueueNode<E>
implements Copyable<PriorityQueueNode.Integer<E>>
An instance of this class encapsulates an (element, priority) pair for an integer valued
priority. This class is used by the various priority queue classes of the library.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cicirello.ds.PriorityQueueNode
PriorityQueueNode.Double<E>, PriorityQueueNode.Integer<E> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.cicirello.ds.PriorityQueueNode
getElement
-
Constructor Details
-
Integer
Initializes the PriorityQueueNode.Integer.- Parameters:
element- The object.value- The value of the object.
-
-
Method Details
-
copy
Creates an identical copy of this object.During the copy, if the element is of a type that also implements
Copyable, then the element is copied. Otherwise, the copy will contain a reference to the same element as the PriorityQueueNode that was copied. -
equals
Checks if another PriorityQueueNode.Integer is equal to this one.- Overrides:
equalsin classPriorityQueueNode<E>- Parameters:
other- The other PriorityQueueNode.Integer.- Returns:
- true if and only if they contain an identical object, determined by the equals method of the encapsulated object, as well as the same priority.
-
hashCode
public int hashCode()Computes the hashCode of the PriorityQueueNode.Integer.- Overrides:
hashCodein classPriorityQueueNode<E>- Returns:
- a hashCode
-
getPriority
public int getPriority()Gets the priority value.- Returns:
- the priority value.
-