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