Package it.unimi.dsi.fastutil.chars
Interface CharPriorityQueue
- All Superinterfaces:
it.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>
- All Known Implementing Classes:
AbstractCharPriorityQueue,CharArrayFIFOQueue,CharArrayPriorityQueue,CharHeapPriorityQueue,CharPriorityQueues.SynchronizedPriorityQueue
public interface CharPriorityQueue
extends it.unimi.dsi.fastutil.PriorityQueue<java.lang.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 java.lang.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(java.lang.Character x)Deprecated.Please use the corresponding type-specific method instead.default java.lang.Characterfirst()Deprecated.Please use the corresponding type-specific method instead.charfirstChar()Returns the first element of the queue.default java.lang.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).Methods inherited from interface it.unimi.dsi.fastutil.PriorityQueue
changed, clear, isEmpty, size
-
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:
java.util.NoSuchElementException- if the queue is empty.- See Also:
dequeue()
-
firstChar
char firstChar()Returns the first element of the queue.- Returns:
- the first element.
- Throws:
java.util.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:
java.util.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.- Specified by:
comparatorin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()- API Notes:
- Note that this specification strengthens the one given in
PriorityQueue.comparator().
-
enqueue
@Deprecated default void enqueue(java.lang.Character x)Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>
-
dequeue
@Deprecated default java.lang.Character dequeue()Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>
-
first
@Deprecated default java.lang.Character first()Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>
-
last
@Deprecated default java.lang.Character last()Deprecated.Please use the corresponding type-specific method instead.This default implementation delegates to the corresponding type-specific method.
- Specified by:
lastin interfaceit.unimi.dsi.fastutil.PriorityQueue<java.lang.Character>
-