Package it.unimi.dsi.fastutil.chars
Class CharPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.chars.CharPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
CharPriorityQueue,PriorityQueue<Character>
- Enclosing class:
CharPriorityQueues
public static class CharPriorityQueues.SynchronizedPriorityQueue
extends Object
implements CharPriorityQueue
A synchronized wrapper class for priority queues.
-
Method Summary
Modifier and TypeMethodDescriptionvoidchanged()Notifies the queue that the first element has changed (optional operation).voidclear()Removes all elements from this queue.Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.dequeue()Deprecated.charDequeues the first element from the queue.voidenqueue(char x) Enqueues a new element.voidDeprecated.booleanfirst()Deprecated.charReturns the first element of the queue.inthashCode()booleanisEmpty()Checks whether this queue is empty.last()Deprecated.charlastChar()Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).intsize()Returns the number of elements in this queue.
-
Method Details
-
enqueue
public void enqueue(char x) Description copied from interface:CharPriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceCharPriorityQueue- Parameters:
x- the element to enqueue.- See Also:
-
dequeueChar
public char dequeueChar()Description copied from interface:CharPriorityQueueDequeues the first element from the queue.- Specified by:
dequeueCharin interfaceCharPriorityQueue- Returns:
- the dequeued element.
- See Also:
-
firstChar
public char firstChar()Description copied from interface:CharPriorityQueueReturns the first element of the queue.- Specified by:
firstCharin interfaceCharPriorityQueue- Returns:
- the first element.
- See Also:
-
lastChar
public char lastChar()Description copied from interface:CharPriorityQueueReturns the last element of the queue, that is, the element the would be dequeued last (optional operation).This default implementation just throws an
UnsupportedOperationException.- Specified by:
lastCharin interfaceCharPriorityQueue- Returns:
- the last element.
- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:PriorityQueueChecks whether this queue is empty.This default implementation checks whether
PriorityQueue.size()is zero.- Specified by:
isEmptyin interfacePriorityQueue<Character>- Returns:
- true if this queue is empty.
-
size
public int size()Description copied from interface:PriorityQueueReturns the number of elements in this queue.- Specified by:
sizein interfacePriorityQueue<Character>- Returns:
- the number of elements in this queue.
-
clear
public void clear()Description copied from interface:PriorityQueueRemoves all elements from this queue.- Specified by:
clearin interfacePriorityQueue<Character>
-
changed
public void changed()Description copied from interface:PriorityQueueNotifies the queue that the first element has changed (optional operation).This default implementation just throws an
UnsupportedOperationException.- Specified by:
changedin interfacePriorityQueue<Character>
-
comparator
Description copied from interface:CharPriorityQueueReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfaceCharPriorityQueue- Specified by:
comparatorin interfacePriorityQueue<Character>- Returns:
- the comparator associated with this priority queue.
- See Also:
-
enqueue
Deprecated.Description copied from interface:CharPriorityQueueEnqueues a new element.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceCharPriorityQueue- Specified by:
enqueuein interfacePriorityQueue<Character>- Parameters:
x- the element to enqueue.
-
dequeue
Deprecated.Description copied from interface:CharPriorityQueueDequeues the first element from the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceCharPriorityQueue- Specified by:
dequeuein interfacePriorityQueue<Character>- Returns:
- the dequeued element.
-
first
Deprecated.Description copied from interface:CharPriorityQueueReturns the first element of the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceCharPriorityQueue- Specified by:
firstin interfacePriorityQueue<Character>- Returns:
- the first element.
-
last
Deprecated.Description copied from interface:CharPriorityQueueReturns 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 interfaceCharPriorityQueue- Specified by:
lastin interfacePriorityQueue<Character>- Returns:
- the last element.
-
hashCode
public int hashCode() -
equals
-