Class PriorityQueueNode<E>

java.lang.Object
org.cicirello.ds.PriorityQueueNode<E>
Type Parameters:
E - The type of element contained in the PriorityQueueNode.
Direct Known Subclasses:
PriorityQueueNode.Double, PriorityQueueNode.Integer

public abstract class PriorityQueueNode<E> extends Object
An instances of the nested subclasses of this class encapsulate an (element, priority) pair for use by the various priority queue classes of the library.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    An instance of this class encapsulates an (element, priority) pair for a double valued priority.
    static final class 
    An instance of this class encapsulates an (element, priority) pair for an integer valued priority.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Checks if another PriorityQueueNode is equal to this one.
    final E
    Gets the encapsulated object.
    int
    Computes the hashCode of the PriorityQueueNode.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equals

      public boolean equals(Object other)
      Checks if another PriorityQueueNode is equal to this one.
      Overrides:
      equals in class Object
      Parameters:
      other - The other PriorityQueueNode.
      Returns:
      true if and only if they contain an identical object, determined by the equals method of the encapsulated object.
    • getElement

      public final E getElement()
      Gets the encapsulated object.
      Returns:
      The object within the pair.
    • hashCode

      public int hashCode()
      Computes the hashCode of the PriorityQueueNode.
      Overrides:
      hashCode in class Object
      Returns:
      a hashCode