it.unimi.dsi.fastutil.ints
Class IntPriorityQueues.SynchronizedPriorityQueue

java.lang.Object
  extended by it.unimi.dsi.fastutil.ints.IntPriorityQueues.SynchronizedPriorityQueue
All Implemented Interfaces:
IntPriorityQueue, PriorityQueue<java.lang.Integer>
Enclosing class:
IntPriorityQueues

public static class IntPriorityQueues.SynchronizedPriorityQueue
extends java.lang.Object
implements IntPriorityQueue

A synchronized wrapper class for priority queues.


Method Summary
 void changed()
          Notifies the queue that the first element has changed (optional operation).
 void clear()
          Removes all elements from this queue.
 IntComparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 java.lang.Integer dequeue()
          Dequeues the first element from the queue.
 int dequeueInt()
          Dequeues the first element from the queue.
 void enqueue(int x)
          Enqueues a new element.
 void enqueue(java.lang.Integer x)
          Enqueues a new element.
 java.lang.Integer first()
          Returns the first element of the queue.
 int firstInt()
          Returns the first element of the queue.
 boolean isEmpty()
          Checks whether the queue is empty.
 java.lang.Integer last()
          Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
 int lastInt()
          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
 

Method Detail

enqueue

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

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

dequeueInt

public int dequeueInt()
Description copied from interface: IntPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeueInt in interface IntPriorityQueue
Returns:
the dequeued element.

firstInt

public int firstInt()
Description copied from interface: IntPriorityQueue
Returns the first element of the queue.

Specified by:
firstInt in interface IntPriorityQueue
Returns:
the first element.

lastInt

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

Specified by:
lastInt in interface IntPriorityQueue
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<java.lang.Integer>
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<java.lang.Integer>
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<java.lang.Integer>

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<java.lang.Integer>

comparator

public IntComparator comparator()
Description copied from interface: IntPriorityQueue
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 IntPriorityQueue
Specified by:
comparator in interface PriorityQueue<java.lang.Integer>
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(java.lang.Integer x)
Description copied from interface: PriorityQueue
Enqueues a new element.

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

dequeue

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

Specified by:
dequeue in interface PriorityQueue<java.lang.Integer>
Returns:
the dequeued element.

first

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

Specified by:
first in interface PriorityQueue<java.lang.Integer>
Returns:
the first element.

last

public java.lang.Integer 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<java.lang.Integer>
Returns:
the last element.