Class PriorityQueueNode.Double<E>

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.
  • Constructor Details

    • Double

      public Double(E element, double value)
      Initializes the PriorityQueueNode.Double.
      Parameters:
      element - The object.
      value - The value of the object.
  • Method Details

    • copy

      public PriorityQueueNode.Double<E> 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.

      Specified by:
      copy in interface Copyable<E>
      Returns:
      an identical copy of this object.
    • equals

      public boolean equals(Object other)
      Checks if another PriorityQueueNode.Double is equal to this one.
      Overrides:
      equals in class PriorityQueueNode<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 class PriorityQueueNode<E>
      Returns:
      a hashCode
    • getPriority

      public double getPriority()
      Gets the priority value.
      Returns:
      the priority value.