Interface BytePriorityQueue
- All Superinterfaces:
PriorityQueue<Byte>
- All Known Implementing Classes:
AbstractBytePriorityQueue,ByteArrayFIFOQueue,ByteArrayPriorityQueue,ByteHeapPriorityQueue,BytePriorityQueues.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 TypeMethodDescriptionReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Bytedequeue()Deprecated.Please use the corresponding type-specific method instead.byteDequeues the first element from the queue.voidenqueue(byte x) Enqueues a new element.default voidDeprecated.Please use the corresponding type-specific method instead.default Bytefirst()Deprecated.Please use the corresponding type-specific method instead.byteReturns the first element of the queue.default Bytelast()Deprecated.Please use the corresponding type-specific method instead.default bytelastByte()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(byte x) Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
-
dequeueByte
byte dequeueByte()Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
-
firstByte
byte firstByte()Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
-
lastByte
default byte lastByte()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
ByteComparator comparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfacePriorityQueue<Byte>- Returns:
- the comparator associated with this priority queue.
- See Also:
- API Notes:
- Note that this specification strengthens the one given in
PriorityQueue.comparator().
-
enqueue
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<Byte>- Parameters:
x- the element to enqueue.
-
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<Byte>- Returns:
- the dequeued element.
-
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<Byte>- Returns:
- the first element.
-
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<Byte>- Returns:
- the last element.
-