it.unimi.dsi.fastutil.floats
Class FloatPriorityQueues.SynchronizedPriorityQueue

java.lang.Object
  extended by 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.


Field Summary
static long serialVersionUID
           
 
Method Summary
 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 sorted set, or null if it uses its elements' natural ordering.
 Float dequeue()
          Dequeues the first element from the queue.
 float dequeueFloat()
          Dequeues the first element from the queue.
 void enqueue(float x)
          Enqueues a new element.
 void enqueue(Float x)
          Enqueues a new element.
 Float first()
          Returns the first element of the queue.
 float firstFloat()
          Returns the first element of the queue.
 boolean isEmpty()
          Checks whether the queue is empty.
 Float last()
          Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

enqueue

public void enqueue(float x)
Description copied from interface: FloatPriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface FloatPriorityQueue
Parameters:
x - the element to enqueue.

dequeueFloat

public float dequeueFloat()
Description copied from interface: FloatPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueFloat in interface FloatPriorityQueue
Returns:
the dequeued element.

firstFloat

public float firstFloat()
Description copied from interface: FloatPriorityQueue
Returns the first element of the queue.

Specified by:
firstFloat in interface FloatPriorityQueue
Returns:
the first element.

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).

Specified by:
lastFloat in interface FloatPriorityQueue
Returns:
the last element.

isEmpty

public boolean isEmpty()
Description copied from interface: PriorityQueue
Checks whether the queue is empty.

Specified by:
isEmpty in interface PriorityQueue<Float>
Returns:
true if the queue is empty.

size

public int size()
Description copied from interface: PriorityQueue
Returns the number of elements in this queue.

Specified by:
size in interface PriorityQueue<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 interface PriorityQueue<Float>

changed

public void changed()
Description copied from interface: PriorityQueue
Notifies the queue that the first element has changed (optional operation).

Specified by:
changed in interface PriorityQueue<Float>

comparator

public FloatComparator comparator()
Description copied from interface: FloatPriorityQueue
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Note that this specification strengthens the one given in PriorityQueue.comparator().

Specified by:
comparator in interface FloatPriorityQueue
Specified by:
comparator in interface PriorityQueue<Float>
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
See Also:
PriorityQueue.comparator()

enqueue

public void enqueue(Float x)
Description copied from interface: PriorityQueue
Enqueues a new element.

Specified by:
enqueue in interface PriorityQueue<Float>
Parameters:
x - the element to enqueue..

dequeue

public Float dequeue()
Description copied from interface: PriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeue in interface PriorityQueue<Float>
Returns:
the dequeued element.

first

public Float first()
Description copied from interface: PriorityQueue
Returns the first element of the queue.

Specified by:
first in interface PriorityQueue<Float>
Returns:
the first element.

last

public Float last()
Description copied from interface: PriorityQueue
Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).

Specified by:
last in interface PriorityQueue<Float>
Returns:
the last element.