Package it.unimi.dsi.fastutil.chars
Class CharPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.chars.CharPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
CharPriorityQueue,PriorityQueue<java.lang.Character>
- Enclosing class:
- CharPriorityQueues
public static class CharPriorityQueues.SynchronizedPriorityQueue extends java.lang.Object implements CharPriorityQueue
A synchronized wrapper class for priority queues.
-
Method Summary
Modifier and Type Method Description voidchanged()Notifies the queue that the first element has changed (optional operation).voidclear()Removes all elements from this queue.CharComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.java.lang.Characterdequeue()Deprecated.chardequeueChar()Dequeues the first element from the queue.voidenqueue(char x)Enqueues a new element.voidenqueue(java.lang.Character x)Deprecated.booleanequals(java.lang.Object o)java.lang.Characterfirst()Deprecated.charfirstChar()Returns the first element of the queue.inthashCode()booleanisEmpty()Checks whether this queue is empty.java.lang.Characterlast()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.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
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:
PriorityQueue.enqueue(Object)
-
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:
CharPriorityQueue.dequeue()
-
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:
CharPriorityQueue.first()
-
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:
CharPriorityQueue.last()
-
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<java.lang.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<java.lang.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<java.lang.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<java.lang.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<java.lang.Character>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated public void enqueue(java.lang.Character x)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<java.lang.Character>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated public java.lang.Character 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<java.lang.Character>- Returns:
- the dequeued element.
-
first
@Deprecated public java.lang.Character 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<java.lang.Character>- Returns:
- the first element.
-
last
@Deprecated public java.lang.Character 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<java.lang.Character>- Returns:
- the last element.
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-