public interface ShortPriorityQueue extends PriorityQueue<Short>
PriorityQueue
; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens comparator()
.
Modifier and Type | Method and Description |
---|---|
ShortComparator |
comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
|
short |
dequeueShort()
Dequeues the first element from the queue.
|
void |
enqueue(short x)
Enqueues a new element.
|
short |
firstShort()
Returns the first element of the queue.
|
short |
lastShort()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
|
void enqueue(short x)
x
- the element to enqueue.short dequeueShort()
NoSuchElementException
- if the queue is empty.short firstShort()
NoSuchElementException
- if the queue is empty.short lastShort()
NoSuchElementException
- if the queue is empty.ShortComparator comparator()
Note that this specification strengthens the one given in PriorityQueue.comparator()
.
comparator
in interface PriorityQueue<Short>
null
if it uses its elements' natural ordering.PriorityQueue.comparator()