PriorityQueue<java.lang.Integer>AbstractIntPriorityQueue, IntArrayFIFOQueue, IntArrayPriorityQueue, IntHeapPriorityQueue, IntPriorityQueues.SynchronizedPriorityQueuepublic interface IntPriorityQueue extends PriorityQueue<java.lang.Integer>
PriorityQueue; provides some additional methods that
use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens comparator().
| Modifier and Type | Method | Description |
|---|---|---|
IntComparator |
comparator() |
Returns the comparator associated with this priority queue, or null if it
uses its elements' natural ordering.
|
default java.lang.Integer |
dequeue() |
Deprecated.
Please use the corresponding type-specific method instead.
|
int |
dequeueInt() |
Dequeues the first element from the queue.
|
void |
enqueue(int x) |
Enqueues a new element.
|
default void |
enqueue(java.lang.Integer x) |
Deprecated.
Please use the corresponding type-specific method instead.
|
default java.lang.Integer |
first() |
Deprecated.
Please use the corresponding type-specific method instead.
|
int |
firstInt() |
Returns the first element of the queue.
|
default java.lang.Integer |
last() |
Deprecated.
Please use the corresponding type-specific method instead.
|
default int |
lastInt() |
Returns the last element of the queue, that is, the element the would be
dequeued last (optional operation).
|
changed, clear, isEmpty, sizevoid enqueue(int x)
x - the element to enqueue.PriorityQueue.enqueue(Object)int dequeueInt()
java.util.NoSuchElementException - if the queue is empty.dequeue()int firstInt()
java.util.NoSuchElementException - if the queue is empty.first()default int lastInt()
This default implementation just throws an
UnsupportedOperationException.
java.util.NoSuchElementException - if the queue is empty.last()IntComparator comparator()
Note that this specification strengthens the one given in
PriorityQueue.comparator().
comparator in interface PriorityQueue<java.lang.Integer>PriorityQueue.comparator()@Deprecated default void enqueue(java.lang.Integer x)
This default implementation delegates to the corresponding type-specific method.
enqueue in interface PriorityQueue<java.lang.Integer>x - the element to enqueue.@Deprecated default java.lang.Integer dequeue()
This default implementation delegates to the corresponding type-specific method.
dequeue in interface PriorityQueue<java.lang.Integer>@Deprecated default java.lang.Integer first()
This default implementation delegates to the corresponding type-specific method.
first in interface PriorityQueue<java.lang.Integer>@Deprecated default java.lang.Integer last()
This default implementation just throws an UnsupportedOperationException.
This default implementation delegates to the corresponding type-specific method.
last in interface PriorityQueue<java.lang.Integer>