Package 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-specificPriorityQueue
; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this interface strengthens
comparator()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description DoubleComparator
comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default java.lang.Double
dequeue()
Deprecated.Please use the corresponding type-specific method instead.double
dequeueDouble()
Dequeues the first element from the queue.void
enqueue(double x)
Enqueues a new element.default void
enqueue(java.lang.Double x)
Deprecated.Please use the corresponding type-specific method instead.default java.lang.Double
first()
Deprecated.Please use the corresponding type-specific method instead.double
firstDouble()
Returns the first element of the queue.default java.lang.Double
last()
Deprecated.Please use the corresponding type-specific method instead.default 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, isEmpty, size
-
-
-
-
Method Detail
-
enqueue
void enqueue(double x)
Enqueues a new element.- Parameters:
x
- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueDouble
double dequeueDouble()
Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
java.util.NoSuchElementException
- if the queue is empty.- See Also:
dequeue()
-
firstDouble
double firstDouble()
Returns the first element of the queue.- Returns:
- the first element.
- Throws:
java.util.NoSuchElementException
- if the queue is empty.- See Also:
first()
-
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:
java.util.NoSuchElementException
- if the queue is empty.- See Also:
last()
-
comparator
DoubleComparator comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparator
in interfacePriorityQueue<java.lang.Double>
- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
- API Notes:
- Note that this specification strengthens the one given in
PriorityQueue.comparator()
.
-
enqueue
@Deprecated default void enqueue(java.lang.Double x)
Deprecated.Please use the corresponding type-specific method instead.Enqueues a new element.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueue
in interfacePriorityQueue<java.lang.Double>
- Parameters:
x
- the element to enqueue.
-
dequeue
@Deprecated default java.lang.Double dequeue()
Deprecated.Please use the corresponding type-specific method instead.Dequeues the first element from the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeue
in interfacePriorityQueue<java.lang.Double>
- Returns:
- the dequeued element.
-
first
@Deprecated default java.lang.Double first()
Deprecated.Please use the corresponding type-specific method instead.Returns the first element of the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
first
in interfacePriorityQueue<java.lang.Double>
- Returns:
- the first element.
-
last
@Deprecated default java.lang.Double last()
Deprecated.Please use the corresponding type-specific method instead.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
.This default implementation delegates to the corresponding type-specific method.
- Specified by:
last
in interfacePriorityQueue<java.lang.Double>
- Returns:
- the last element.
-
-