Package it.unimi.dsi.fastutil.floats
Class FloatPriorityQueues.SynchronizedPriorityQueue
java.lang.Object
it.unimi.dsi.fastutil.floats.FloatPriorityQueues.SynchronizedPriorityQueue
- All Implemented Interfaces:
FloatPriorityQueue,PriorityQueue<java.lang.Float>
- Enclosing class:
- FloatPriorityQueues
public static class FloatPriorityQueues.SynchronizedPriorityQueue extends java.lang.Object implements FloatPriorityQueue
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.FloatComparatorcomparator()Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.java.lang.Floatdequeue()Deprecated.floatdequeueFloat()Dequeues the first element from the queue.voidenqueue(float x)Enqueues a new element.voidenqueue(java.lang.Float x)Deprecated.booleanequals(java.lang.Object o)java.lang.Floatfirst()Deprecated.floatfirstFloat()Returns the first element of the queue.inthashCode()booleanisEmpty()Checks whether this queue is empty.java.lang.Floatlast()Deprecated.floatlastFloat()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(float x)Description copied from interface:FloatPriorityQueueEnqueues a new element.- Specified by:
enqueuein interfaceFloatPriorityQueue- Parameters:
x- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
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:
FloatPriorityQueue.dequeue()
-
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:
FloatPriorityQueue.first()
-
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:
FloatPriorityQueue.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.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<java.lang.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<java.lang.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<java.lang.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<java.lang.Float>- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated public void enqueue(java.lang.Float x)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<java.lang.Float>- Parameters:
x- the element to enqueue.
-
dequeue
@Deprecated public java.lang.Float 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<java.lang.Float>- Returns:
- the dequeued element.
-
first
@Deprecated public java.lang.Float 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<java.lang.Float>- Returns:
- the first element.
-
last
@Deprecated public java.lang.Float 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<java.lang.Float>- 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
-