Package it.unimi.dsi.fastutil.bytes
Class BytePriorityQueues.SynchronizedPriorityQueue
- java.lang.Object
-
- it.unimi.dsi.fastutil.bytes.BytePriorityQueues.SynchronizedPriorityQueue
-
- All Implemented Interfaces:
BytePriorityQueue,PriorityQueue<Byte>
- Enclosing class:
- BytePriorityQueues
public static class BytePriorityQueues.SynchronizedPriorityQueue extends Object implements BytePriorityQueue
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.ByteComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.Bytedequeue()Deprecated.bytedequeueByte()Dequeues the first element from the queue.voidenqueue(byte x)Enqueues a new element.voidenqueue(Byte x)Deprecated.booleanequals(Object o)Bytefirst()Deprecated.bytefirstByte()Returns the first element of the queue.inthashCode()booleanisEmpty()Checks whether this queue is empty.Bytelast()Deprecated.bytelastByte()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 Detail
-
enqueue
public void enqueue(byte x)
Description copied from interface:BytePriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceBytePriorityQueue- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueByte
public byte dequeueByte()
Description copied from interface:BytePriorityQueueDequeues the first element from the queue.- Specified by:
dequeueBytein interfaceBytePriorityQueue- Returns:
- the dequeued element.
- See Also:
BytePriorityQueue.dequeue()
-
firstByte
public byte firstByte()
Description copied from interface:BytePriorityQueueReturns the first element of the queue.- Specified by:
firstBytein interfaceBytePriorityQueue- Returns:
- the first element.
- See Also:
BytePriorityQueue.first()
-
lastByte
public byte lastByte()
Description copied from interface:BytePriorityQueueReturns 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:
lastBytein interfaceBytePriorityQueue- Returns:
- the last element.
- See Also:
BytePriorityQueue.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<Byte>- 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<Byte>- 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<Byte>
-
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<Byte>
-
comparator
public ByteComparator comparator()
Description copied from interface:BytePriorityQueueReturns 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 interfaceBytePriorityQueue- Specified by:
comparatorin interfacePriorityQueue<Byte>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated public void enqueue(Byte x)
Deprecated.Description copied from interface:BytePriorityQueueEnqueues a new element.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceBytePriorityQueue- Specified by:
enqueuein interfacePriorityQueue<Byte>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated public Byte dequeue()
Deprecated.Description copied from interface:BytePriorityQueueDequeues the first element from the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceBytePriorityQueue- Specified by:
dequeuein interfacePriorityQueue<Byte>- Returns:
- the dequeued element.
-
first
@Deprecated public Byte first()
Deprecated.Description copied from interface:BytePriorityQueueReturns the first element of the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceBytePriorityQueue- Specified by:
firstin interfacePriorityQueue<Byte>- Returns:
- the first element.
-
last
@Deprecated public Byte last()
Deprecated.Description copied from interface:BytePriorityQueueReturns 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 interfaceBytePriorityQueue- Specified by:
lastin interfacePriorityQueue<Byte>- Returns:
- the last element.
-
-