Package it.unimi.dsi.fastutil.shorts
Interface ShortPriorityQueue
-
- All Superinterfaces:
PriorityQueue<Short>
- All Known Implementing Classes:
AbstractShortPriorityQueue,ShortArrayFIFOQueue,ShortArrayPriorityQueue,ShortHeapPriorityQueue,ShortPriorityQueues.SynchronizedPriorityQueue
public interface ShortPriorityQueue extends PriorityQueue<Short>
A type-specificPriorityQueue; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this interface strengthens
comparator().
-
-
Method Summary
Modifier and Type Method Description ShortComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Shortdequeue()Deprecated.Please use the corresponding type-specific method instead.shortdequeueShort()Dequeues the first element from the queue.voidenqueue(short x)Enqueues a new element.default voidenqueue(Short x)Deprecated.Please use the corresponding type-specific method instead.default Shortfirst()Deprecated.Please use the corresponding type-specific method instead.shortfirstShort()Returns the first element of the queue.default Shortlast()Deprecated.Please use the corresponding type-specific method instead.default shortlastShort()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(short x)
Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueShort
short dequeueShort()
Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
dequeue()
-
firstShort
short firstShort()
Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
first()
-
lastShort
default short lastShort()
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:
last()
-
comparator
ShortComparator comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.Note that this specification strengthens the one given in
PriorityQueue.comparator().- Specified by:
comparatorin interfacePriorityQueue<Short>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated default void enqueue(Short 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<Short>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated default Short 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<Short>- Returns:
- the dequeued element.
-
first
@Deprecated default Short 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<Short>- Returns:
- the first element.
-
last
@Deprecated default Short 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<Short>- Returns:
- the last element.
-
-