it.unimi.dsi.fastutil.doubles
Interface DoublePriorityQueue

All Superinterfaces:
PriorityQueue<java.lang.Double>
All Known Implementing Classes:
AbstractDoublePriorityQueue, DoubleArrayFIFOQueue, DoubleArrayPriorityQueue, DoubleHeapPriorityQueue, DoublePriorityQueues.SynchronizedPriorityQueue

public interface DoublePriorityQueue
extends PriorityQueue<java.lang.Double>

A type-specific PriorityQueue; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens comparator().


Method Summary
 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).
 
Methods inherited from interface it.unimi.dsi.fastutil.PriorityQueue
changed, clear, dequeue, enqueue, first, isEmpty, last, size
 

Method Detail

enqueue

void enqueue(double x)
Enqueues a new element.

Parameters:
x - the element to enqueue.

dequeueDouble

double dequeueDouble()
Dequeues the first element from the queue.

Returns:
the dequeued element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

firstDouble

double firstDouble()
Returns the first element of the queue.

Returns:
the first element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

lastDouble

double lastDouble()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

Returns:
the last element.
Throws:
java.util.NoSuchElementException - if the queue is empty.

comparator

DoubleComparator comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Note that this specification strengthens the one given in PriorityQueue.comparator().

Specified by:
comparator in interface PriorityQueue<java.lang.Double>
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
See Also:
PriorityQueue.comparator()