Package minpq

Class PriorityNode<T>

  • Type Parameters:
    T - the type of element represented by this node.

    class PriorityNode<T>
    extends Object
    Represents the item-priority pair for use in ExtrinsicMinPQ implementations.
    See Also:
    ExtrinsicMinPQ
    • Field Detail

      • item

        private final T item
      • priority

        private double priority
    • Constructor Detail

      • PriorityNode

        PriorityNode​(T item,
                     double priority)
        Constructs a pair with the given item and priority.
        Parameters:
        item - the item in this pair.
        priority - the priority value associated with the item.
    • Method Detail

      • item

        T item()
        Returns the item.
        Returns:
        the item.
      • priority

        double priority()
        Returns the priority value.
        Returns:
        the priority value.
      • setPriority

        void setPriority​(double priority)
        Reassigns the priority value for this pair.
        Parameters:
        priority - the priority value to be assigned.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object