Package it.unimi.dsi.fastutil.floats
Interface FloatPriorityQueue
- All Superinterfaces:
PriorityQueue<java.lang.Float>
- All Known Implementing Classes:
AbstractFloatPriorityQueue,FloatArrayFIFOQueue,FloatArrayPriorityQueue,FloatHeapPriorityQueue,FloatPriorityQueues.SynchronizedPriorityQueue
public interface FloatPriorityQueue extends PriorityQueue<java.lang.Float>
A type-specific
PriorityQueue; provides some additional methods that
use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens comparator().
-
Method Summary
Modifier and Type Method Description FloatComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default java.lang.Floatdequeue()Deprecated.Please use the corresponding type-specific method instead.floatdequeueFloat()Dequeues the first element from the queue.voidenqueue(float x)Enqueues a new element.default voidenqueue(java.lang.Float x)Deprecated.Please use the corresponding type-specific method instead.default java.lang.Floatfirst()Deprecated.Please use the corresponding type-specific method instead.floatfirstFloat()Returns the first element of the queue.default java.lang.Floatlast()Deprecated.Please use the corresponding type-specific method instead.default floatlastFloat()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 Details
-
enqueue
void enqueue(float x)Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueFloat
float dequeueFloat()Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
java.util.NoSuchElementException- if the queue is empty.- See Also:
dequeue()
-
firstFloat
float firstFloat()Returns the first element of the queue.- Returns:
- the first element.
- Throws:
java.util.NoSuchElementException- if the queue is empty.- See Also:
first()
-
lastFloat
default float lastFloat()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
FloatComparator comparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfacePriorityQueue<java.lang.Float>- 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.Float 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:
enqueuein interfacePriorityQueue<java.lang.Float>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated default java.lang.Float 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:
dequeuein interfacePriorityQueue<java.lang.Float>- Returns:
- the dequeued element.
-
first
@Deprecated default java.lang.Float 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:
firstin interfacePriorityQueue<java.lang.Float>- Returns:
- the first element.
-
last
@Deprecated default java.lang.Float 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:
lastin interfacePriorityQueue<java.lang.Float>- Returns:
- the last element.
-