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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
changed()
Notifies the queue that the first element has changed (optional operation).void
clear()
Removes all elements from this queue.FloatComparator
comparator()
Returns the comparator associated with this priority queue, or null if it uses its elements' natural ordering.Float
dequeue()
Deprecated.float
dequeueFloat()
Dequeues the first element from the queue.void
enqueue(float x)
Enqueues a new element.void
enqueue(Float x)
Deprecated.boolean
equals(Object o)
Float
first()
Deprecated.float
firstFloat()
Returns the first element of the queue.int
hashCode()
boolean
isEmpty()
Checks whether this queue is empty.Float
last()
Deprecated.float
lastFloat()
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).int
size()
Returns the number of elements in this queue.
-
-
-
Method Detail
-
enqueue
public void enqueue(float x)
Description copied from interface:FloatPriorityQueue
Enqueues a new element.- Specified by:
enqueue
in interfaceFloatPriorityQueue
- Parameters:
x
- the element to enqueue.- See Also:
PriorityQueue.enqueue(Object)
-
dequeueFloat
public float dequeueFloat()
Description copied from interface:FloatPriorityQueue
Dequeues the first element from the queue.- Specified by:
dequeueFloat
in interfaceFloatPriorityQueue
- Returns:
- the dequeued element.
- See Also:
FloatPriorityQueue.dequeue()
-
firstFloat
public float firstFloat()
Description copied from interface:FloatPriorityQueue
Returns the first element of the queue.- Specified by:
firstFloat
in interfaceFloatPriorityQueue
- Returns:
- the first element.
- See Also:
FloatPriorityQueue.first()
-
lastFloat
public float lastFloat()
Description copied from interface:FloatPriorityQueue
Returns 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:
lastFloat
in interfaceFloatPriorityQueue
- Returns:
- the last element.
- See Also:
FloatPriorityQueue.last()
-
isEmpty
public boolean isEmpty()
Description copied from interface:PriorityQueue
Checks whether this queue is empty.This default implementation checks whether
PriorityQueue.size()
is zero.- Specified by:
isEmpty
in interfacePriorityQueue<Float>
- Returns:
- true if this queue is empty.
-
size
public int size()
Description copied from interface:PriorityQueue
Returns the number of elements in this queue.- Specified by:
size
in interfacePriorityQueue<Float>
- Returns:
- the number of elements in this queue.
-
clear
public void clear()
Description copied from interface:PriorityQueue
Removes all elements from this queue.- Specified by:
clear
in interfacePriorityQueue<Float>
-
changed
public void changed()
Description copied from interface:PriorityQueue
Notifies the queue that the first element has changed (optional operation).This default implementation just throws an
UnsupportedOperationException
.- Specified by:
changed
in interfacePriorityQueue<Float>
-
comparator
public FloatComparator comparator()
Description copied from interface:FloatPriorityQueue
Returns 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:
comparator
in interfaceFloatPriorityQueue
- Specified by:
comparator
in interfacePriorityQueue<Float>
- Returns:
- the comparator associated with this priority queue.
- See Also:
PriorityQueue.comparator()
-
enqueue
@Deprecated public void enqueue(Float x)
Deprecated.Description copied from interface:FloatPriorityQueue
Enqueues a new element.This default implementation delegates to the corresponding type-specific method.
- Specified by:
enqueue
in interfaceFloatPriorityQueue
- Specified by:
enqueue
in interfacePriorityQueue<Float>
- Parameters:
x
- the element to enqueue.
-
dequeue
@Deprecated public Float dequeue()
Deprecated.Description copied from interface:FloatPriorityQueue
Dequeues the first element from the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
dequeue
in interfaceFloatPriorityQueue
- Specified by:
dequeue
in interfacePriorityQueue<Float>
- Returns:
- the dequeued element.
-
first
@Deprecated public Float first()
Deprecated.Description copied from interface:FloatPriorityQueue
Returns the first element of the queue.This default implementation delegates to the corresponding type-specific method.
- Specified by:
first
in interfaceFloatPriorityQueue
- Specified by:
first
in interfacePriorityQueue<Float>
- Returns:
- the first element.
-
last
@Deprecated public Float last()
Deprecated.Description copied from interface:FloatPriorityQueue
Returns 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:
last
in interfaceFloatPriorityQueue
- Specified by:
last
in interfacePriorityQueue<Float>
- Returns:
- the last element.
-
-