Package it.unimi.dsi.fastutil.floats
Class FloatPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.floats.FloatPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
FloatPriorityQueue,PriorityQueue<Float>
- Enclosing class:
- FloatPriorityQueues
public static class FloatPriorityQueues.SynchronizedPriorityQueue
extends Object
implements FloatPriorityQueue
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.floatDequeues the first element from the queue.voidenqueue(float x) Enqueues a new element.voidDeprecated.booleanfirst()Deprecated.floatReturns the first element of the queue.inthashCode()booleanisEmpty()Checks whether this queue is empty.last()Deprecated.floatReturns 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(float x) Description copied from interface:FloatPriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceFloatPriorityQueue- Parameters:
x- the element to enqueue.- See Also:
-
dequeueFloat
public float dequeueFloat()Description copied from interface:FloatPriorityQueueDequeues the first element from the queue.- Specified by:
dequeueFloatin interfaceFloatPriorityQueue- Returns:
- the dequeued element.
- See Also:
-
firstFloat
public float firstFloat()Description copied from interface:FloatPriorityQueueReturns the first element of the queue.- Specified by:
firstFloatin interfaceFloatPriorityQueue- Returns:
- the first element.
- See Also:
-
lastFloat
public float lastFloat()Description copied from interface:FloatPriorityQueueReturns 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:
lastFloatin interfaceFloatPriorityQueue- 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<Float>- 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<Float>- 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<Float>
-
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<Float>
-
comparator
Description copied from interface:FloatPriorityQueueReturns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.- Specified by:
comparatorin interfaceFloatPriorityQueue- Specified by:
comparatorin interfacePriorityQueue<Float>- Returns:
- the comparator associated with this priority queue.
- See Also:
-
enqueue
Deprecated.Description copied from interface:FloatPriorityQueueEnqueues a new element.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueuein interfaceFloatPriorityQueue- Specified by:
enqueuein interfacePriorityQueue<Float>- Parameters:
x- the element to enqueue.
-
dequeue
Deprecated.Description copied from interface:FloatPriorityQueueDequeues the first element from the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeuein interfaceFloatPriorityQueue- Specified by:
dequeuein interfacePriorityQueue<Float>- Returns:
- the dequeued element.
-
first
Deprecated.Description copied from interface:FloatPriorityQueueReturns the first element of the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
firstin interfaceFloatPriorityQueue- Specified by:
firstin interfacePriorityQueue<Float>- Returns:
- the first element.
-
last
Deprecated.Description copied from interface:FloatPriorityQueueReturns 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 interfaceFloatPriorityQueue- Specified by:
lastin interfacePriorityQueue<Float>- Returns:
- the last element.
-
hashCode
public int hashCode() -
equals
-