Package it.unimi.dsi.fastutil.chars
Interface CharPriorityQueue
- All Superinterfaces:
PriorityQueue<Character>
- All Known Implementing Classes:
AbstractCharPriorityQueue,CharArrayFIFOQueue,CharArrayPriorityQueue,CharHeapPriorityQueue,CharPriorityQueues.SynchronizedPriorityQueue
public interface CharPriorityQueue extends PriorityQueue<Character>
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 CharComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.default Characterdequeue()Deprecated.Please use the corresponding type-specific method instead.chardequeueChar()Dequeues the first element from the queue.voidenqueue(char x)Enqueues a new element.default voidenqueue(Character x)Deprecated.Please use the corresponding type-specific method instead.default Characterfirst()Deprecated.Please use the corresponding type-specific method instead.charfirstChar()Returns the first element of the queue.default Characterlast()Deprecated.Please use the corresponding type-specific method instead.default charlastChar()Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
-
Method Details
-
enqueue
void enqueue(char x)Enqueues a new element.- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueChar
char dequeueChar()Dequeues the first element from the queue.- Returns:
- the dequeued element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
dequeue()
-
firstChar
char firstChar()Returns the first element of the queue.- Returns:
- the first element.
- Throws:
NoSuchElementException- if the queue is empty.- See Also:
first()
-
lastChar
default char lastChar()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
CharComparator 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<Character>- Returns:
- the comparator associated with this priority queue.
- See Also:
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<Character>- 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<Character>- 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<Character>- 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<Character>- Returns:
- the last element.
-