Interface IntPriorityQueue

All Superinterfaces:
it.unimi.dsi.fastutil.PriorityQueue<Integer>
All Known Implementing Classes:
IntArrayFIFOQueue, IntArrayPriorityQueue, IntHeapPriorityQueue, IntPriorityQueues.SynchronizedPriorityQueue

public interface IntPriorityQueue extends it.unimi.dsi.fastutil.PriorityQueue<Integer>
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
    it.unimi.dsi.fastutil.ints.IntComparator
    Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
    default Integer
    Deprecated.
    Please use the corresponding type-specific method instead.
    int
    Dequeues the first element from the queue.
    void
    enqueue(int x)
    Enqueues a new element.
    default void
    Deprecated.
    Please use the corresponding type-specific method instead.
    default Integer
    Deprecated.
    Please use the corresponding type-specific method instead.
    int
    Returns the first element of the queue.
    default Integer
    Deprecated.
    Please use the corresponding type-specific method instead.
    default int
    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(int x)
      Enqueues a new element.
      Parameters:
      x - the element to enqueue.
      See Also:
      • PriorityQueue.enqueue(Object)
    • dequeueInt

      int dequeueInt()
      Dequeues the first element from the queue.
      Returns:
      the dequeued element.
      Throws:
      NoSuchElementException - if the queue is empty.
      See Also:
    • firstInt

      int firstInt()
      Returns the first element of the queue.
      Returns:
      the first element.
      Throws:
      NoSuchElementException - if the queue is empty.
      See Also:
    • lastInt

      default int lastInt()
      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

      it.unimi.dsi.fastutil.ints.IntComparator comparator()
      Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.
      Specified by:
      comparator in interface it.unimi.dsi.fastutil.PriorityQueue<Integer>
      Returns:
      the comparator associated with this priority queue.
      See Also:
      • PriorityQueue.comparator()
    • enqueue

      @Deprecated default void enqueue(Integer x)
      Deprecated.
      Please use the corresponding type-specific method instead.

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

      Specified by:
      enqueue in interface it.unimi.dsi.fastutil.PriorityQueue<Integer>
    • dequeue

      @Deprecated default Integer dequeue()
      Deprecated.
      Please use the corresponding type-specific method instead.

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

      Specified by:
      dequeue in interface it.unimi.dsi.fastutil.PriorityQueue<Integer>
    • first

      @Deprecated default Integer first()
      Deprecated.
      Please use the corresponding type-specific method instead.

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

      Specified by:
      first in interface it.unimi.dsi.fastutil.PriorityQueue<Integer>
    • last

      @Deprecated default Integer last()
      Deprecated.
      Please use the corresponding type-specific method instead.

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

      Specified by:
      last in interface it.unimi.dsi.fastutil.PriorityQueue<Integer>