Interface PriorityLinkedList<E>

  • All Known Implementing Classes:
    PriorityLinkedListImpl

    public interface PriorityLinkedList<E>
    A type of linked list which maintains items according to a priority and allows adding and removing of elements at both ends, and peeking.
    Only size() and isEmpty() are safe to be called concurrently.
    • Method Detail

      • addHead

        void addHead​(E e,
                     int priority)
      • addTail

        void addTail​(E e,
                     int priority)
      • addSorted

        void addSorted​(E e,
                       int priority)
      • poll

        E poll()
      • peek

        E peek()
        just look at the first element on the list
      • clear

        void clear()
      • removeWithID

        E removeWithID​(String listID,
                       long id)
      • size

        int size()
        Returns the size of this list.
        It is safe to be called concurrently.
      • isEmpty

        boolean isEmpty()
        Returns true if empty, false otherwise.
        It is safe to be called concurrently.