Package it.unimi.dsi.fastutil.doubles
Interface DoublePriorityQueue
- All Superinterfaces:
it.unimi.dsi.fastutil.PriorityQueue<Double>
- All Known Implementing Classes:
DoubleArrayFIFOQueue,DoubleArrayPriorityQueue,DoubleHeapPriorityQueue,DoublePriorityQueues.SynchronizedPriorityQueue
A type-specific
PriorityQueue; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens comparator().
-
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.doubles.DoubleComparatorReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Doubledequeue()Deprecated.Please use the corresponding type-specific method instead.doubleDequeues the first element from the queue.voidenqueue(double x) Enqueues a new element.default voidDeprecated.Please use the corresponding type-specific method instead.default Doublefirst()Deprecated.Please use the corresponding type-specific method instead.doubleReturns the first element of the queue.default Doublelast()Deprecated.Please use the corresponding type-specific method instead.default doubleReturns 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, isEmpty, size
-
Method Details
-
enqueue
void enqueue(double x) Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
-
dequeueDouble
double dequeueDouble()Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
-
firstDouble
double firstDouble()Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
-
lastDouble
default double lastDouble()Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).This default implementation just throws an
UnsupportedOperationException.- Returns:
- the last element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
-
comparator
it.unimi.dsi.fastutil.doubles.DoubleComparator comparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfaceit.unimi.dsi.fastutil.PriorityQueue<Double>- Returns:
- the comparator associated with this priority queue.
- See Also:
-
enqueue
Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceit.unimi.dsi.fastutil.PriorityQueue<Double>
-
dequeue
Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceit.unimi.dsi.fastutil.PriorityQueue<Double>
-
first
Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceit.unimi.dsi.fastutil.PriorityQueue<Double>
-
last
Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
lastin interfaceit.unimi.dsi.fastutil.PriorityQueue<Double>
-