Package it.unimi.dsi.fastutil.bytes
Interface BytePriorityQueue
-
- All Superinterfaces:
PriorityQueue<Byte>
- All Known Implementing Classes:
AbstractBytePriorityQueue
,ByteArrayFIFOQueue
,ByteArrayPriorityQueue
,ByteHeapPriorityQueue
,BytePriorityQueues.SynchronizedPriorityQueue
public interface BytePriorityQueue extends PriorityQueue<Byte>
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 ByteComparator
comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Byte
dequeue()
Deprecated.Please use the corresponding type-specific method instead.byte
dequeueByte()
Dequeues the first element from the queue.void
enqueue(byte x)
Enqueues a new element.default void
enqueue(Byte x)
Deprecated.Please use the corresponding type-specific method instead.default Byte
first()
Deprecated.Please use the corresponding type-specific method instead.byte
firstByte()
Returns the first element of the queue.default Byte
last()
Deprecated.Please use the corresponding type-specific method instead.default byte
lastByte()
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(byte x)
Enqueues a new element.- Parameters:
x
- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueByte
byte dequeueByte()
Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException
- if the queue is empty.- See Also:
dequeue()
-
firstByte
byte firstByte()
Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException
- if the queue is empty.- See Also:
first()
-
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:
last()
-
comparator
ByteComparator 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:
comparator
in interfacePriorityQueue<Byte>
- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated default void enqueue(Byte 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<Byte>
- Parameters:
x
- the element to enqueue.
-
dequeue
@Deprecated default Byte 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<Byte>
- Returns:
- the dequeued element.
-
first
@Deprecated default Byte 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<Byte>
- Returns:
- the first element.
-
last
@Deprecated default Byte 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<Byte>
- Returns:
- the last element.
-
-