java.lang.Object
org.cicirello.ds.PriorityQueueNode<E>
org.cicirello.ds.PriorityQueueNode.Double<E>
- Type Parameters:
E
- The type of element contained in the PriorityQueueNode.
- All Implemented Interfaces:
Copyable<PriorityQueueNode.Double<E>>
- Enclosing class:
- PriorityQueueNode<E>
public static final class PriorityQueueNode.Double<E>
extends PriorityQueueNode<E>
implements Copyable<PriorityQueueNode.Double<E>>
An instance of this class encapsulates an (element, priority) pair for a double 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
-
Method Summary
Methods inherited from class org.cicirello.ds.PriorityQueueNode
getElement
-
Constructor Details
-
Double
Initializes the PriorityQueueNode.Double.- 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.Double is equal to this one.- Overrides:
equals
in classPriorityQueueNode<E>
- Parameters:
other
- The other PriorityQueueNode.Double.- 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.Double.- Overrides:
hashCode
in classPriorityQueueNode<E>
- Returns:
- a hashCode
-
getPriority
public double getPriority()Gets the priority value.- Returns:
- the priority value.
-