Interface CharPriorityQueue

All Superinterfaces:
PriorityQueue<Character>
All Known Implementing Classes:
AbstractCharPriorityQueue, CharArrayFIFOQueue, CharArrayPriorityQueue, CharHeapPriorityQueue, CharPriorityQueues.SynchronizedPriorityQueue

public interface CharPriorityQueue extends PriorityQueue<Character>
A type-specific PriorityQueue; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens comparator().

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
    default Character
    Deprecated.
    Please use the corresponding type-specific method instead.
    char
    Dequeues the first element from the queue.
    void
    enqueue(char x)
    Enqueues a new element.
    default void
    Deprecated.
    Please use the corresponding type-specific method instead.
    default Character
    Deprecated.
    Please use the corresponding type-specific method instead.
    char
    Returns the first element of the queue.
    default Character
    Deprecated.
    Please use the corresponding type-specific method instead.
    default char
    Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

    Methods inherited from interface it.unimi.dsi.fastutil.PriorityQueue

    changed, clear, isEmpty, size
  • Method Details

    • enqueue

      void enqueue(char x)
      Enqueues a new element.
      Parameters:
      x - the element to enqueue.
      See Also:
    • dequeueChar

      char dequeueChar()
      Dequeues the first element from the queue.
      Returns:
      the dequeued element.
      Throws:
      NoSuchElementException - if the queue is empty.
      See Also:
    • firstChar

      char firstChar()
      Returns the first element of the queue.
      Returns:
      the first element.
      Throws:
      NoSuchElementException - if the queue is empty.
      See Also:
    • lastChar

      default char lastChar()
      Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

      This default implementation just throws an UnsupportedOperationException.

      Returns:
      the last element.
      Throws:
      NoSuchElementException - if the queue is empty.
      See Also:
    • comparator

      CharComparator comparator()
      Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
      Specified by:
      comparator in interface PriorityQueue<Character>
      Returns:
      the comparator associated with this priority queue.
      See Also:
      API Notes:
      Note that this specification strengthens the one given in PriorityQueue.comparator().
    • enqueue

      @Deprecated default void enqueue(Character x)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Enqueues a new element.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      enqueue in interface PriorityQueue<Character>
      Parameters:
      x - the element to enqueue.
    • dequeue

      @Deprecated default Character dequeue()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Dequeues the first element from the queue.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      dequeue in interface PriorityQueue<Character>
      Returns:
      the dequeued element.
    • first

      @Deprecated default Character first()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Returns the first element of the queue.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      first in interface PriorityQueue<Character>
      Returns:
      the first element.
    • last

      @Deprecated default Character last()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

      This default implementation just throws an UnsupportedOperationException.

      This default implementation delegates to the corresponding type-specific method.

      Specified by:
      last in interface PriorityQueue<Character>
      Returns:
      the last element.