Package it.unimi.dsi.fastutil.longs
Interface LongPriorityQueue
-
- All Superinterfaces:
PriorityQueue<Long>
- All Known Implementing Classes:
AbstractLongPriorityQueue,LongArrayFIFOQueue,LongArrayPriorityQueue,LongHeapPriorityQueue,LongPriorityQueues.SynchronizedPriorityQueue
public interface LongPriorityQueue extends PriorityQueue<Long>
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 LongComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Longdequeue()Deprecated.Please use the corresponding type-specific method instead.longdequeueLong()Dequeues the first element from the queue.voidenqueue(long x)Enqueues a new element.default voidenqueue(Long x)Deprecated.Please use the corresponding type-specific method instead.default Longfirst()Deprecated.Please use the corresponding type-specific method instead.longfirstLong()Returns the first element of the queue.default Longlast()Deprecated.Please use the corresponding type-specific method instead.default longlastLong()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(long x)
Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueLong
long dequeueLong()
Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
dequeue()
-
firstLong
long firstLong()
Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
first()
-
lastLong
default long lastLong()
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
LongComparator 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<Long>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated default void enqueue(Long 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<Long>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated default Long 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<Long>- Returns:
- the dequeued element.
-
first
@Deprecated default Long 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<Long>- Returns:
- the first element.
-
last
@Deprecated default Long 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<Long>- Returns:
- the last element.
-
-