Interface SmartDynamicPriorityQueue<E>

  • Type Parameters:
    E - element class.
    All Superinterfaces:
    Collection<E>, Iterable<E>, SmartCollection<E>, SmartPriorityQueue<E>
    All Known Implementing Classes:
    BinaryHeap

    public interface SmartDynamicPriorityQueue<E>
    extends SmartPriorityQueue<E>
    A priority queue interface.

    A priority queue is a queue which supports removal of the element with the minimal key value (wrt. natural ordering or an explicitly specified Comparator).

    This interface extends the functionality of the standard PriorityQueue in the way that it allows dynamic behavior: The ordering of the elements in the queue is allowed to change. The only restriction is that whenever the key which is used for comparison changes, the method keyChanged(ElementReference) has to be called with the reference of the respective element.

    • Method Detail

      • keyChanged

        void keyChanged​(ElementReference reference)
        Notifies the implementation that the key of an element has changed.
        Parameters:
        reference - the reference for the element whose key has changed.