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