it.unimi.dsi.fastutil
Class IndirectDoublePriorityQueues.SynchronizedIndirectDoublePriorityQueue

java.lang.Object
  extended byit.unimi.dsi.fastutil.IndirectDoublePriorityQueues.SynchronizedIndirectDoublePriorityQueue
All Implemented Interfaces:
IndirectDoublePriorityQueue, IndirectPriorityQueue
Enclosing class:
IndirectDoublePriorityQueues

public static class IndirectDoublePriorityQueues.SynchronizedIndirectDoublePriorityQueue
extends Object
implements IndirectDoublePriorityQueue

A synchronized wrapper class for indirect double priority queues.


Field Summary
static long serialVersionUID
           
 
Method Summary
 void allChanged()
          Notifies the queue that the all elements have changed (optional operation).
 void changed()
          Notifies the queue that the first element has changed (optional operation).
 void changed(int i)
          Notifies the queue that the specified element has changed (optional operation).
 void clear()
          Removes all elements from this queue.
 Comparator comparator()
          Returns the comparator associated with this queue, or null if it uses its elements' natural ordering.
 int dequeue()
          Dequeues the first element from the queue.
 void enqueue(int x)
          Enqueues a new element.
 int first()
          Returns the first element of the queue.
 boolean isEmpty()
          Checks whether the queue is empty.
 int last()
          Returns the last element of the queue, that is, the element the would be dequeued last (optional operation).
 void remove(int i)
          Removes the specified element from the queue (optional operation).
 Comparator secondaryComparator()
          Returns the secondary comparator of this queue.
 int secondaryFirst()
          Returns the first element of this queue with respect to the secondary comparator.
 int secondaryLast()
          Returns the last element of this queue with respect to the secondary comparator (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(int x)
Description copied from interface: IndirectPriorityQueue
Enqueues a new element.

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

dequeue

public int dequeue()
Description copied from interface: IndirectPriorityQueue
Dequeues the first element from the queue.

Specified by:
dequeue in interface IndirectPriorityQueue
Returns:
the dequeued element.

first

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

Specified by:
first in interface IndirectPriorityQueue
Returns:
the first element.

last

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

Specified by:
last in interface IndirectPriorityQueue
Returns:
the last element.

secondaryFirst

public int secondaryFirst()
Description copied from interface: IndirectDoublePriorityQueue
Returns the first element of this queue with respect to the secondary comparator.

Specified by:
secondaryFirst in interface IndirectDoublePriorityQueue
Returns:
the first element of this queue w.r.t. the secondary comparator.

secondaryLast

public int secondaryLast()
Description copied from interface: IndirectDoublePriorityQueue
Returns the last element of this queue with respect to the secondary comparator (optional operation).

Specified by:
secondaryLast in interface IndirectDoublePriorityQueue
Returns:
the last element of this queue w.r.t. the secondary comparator.

isEmpty

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

Specified by:
isEmpty in interface IndirectPriorityQueue
Returns:
true if the queue is empty.

size

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

Specified by:
size in interface IndirectPriorityQueue
Returns:
the number of elements in this queue.

clear

public void clear()
Description copied from interface: IndirectPriorityQueue
Removes all elements from this queue.

Specified by:
clear in interface IndirectPriorityQueue

changed

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

Specified by:
changed in interface IndirectPriorityQueue

allChanged

public void allChanged()
Description copied from interface: IndirectPriorityQueue
Notifies the queue that the all elements have changed (optional operation).

Specified by:
allChanged in interface IndirectPriorityQueue

changed

public void changed(int i)
Description copied from interface: IndirectPriorityQueue
Notifies the queue that the specified element has changed (optional operation).

Note that the specified element must belong to the queue.

Specified by:
changed in interface IndirectPriorityQueue
Parameters:
i - the element that has changed.

remove

public void remove(int i)
Description copied from interface: IndirectPriorityQueue
Removes the specified element from the queue (optional operation).

Note that the specified element must belong to the queue.

Specified by:
remove in interface IndirectPriorityQueue
Parameters:
i - the element to be removed.

comparator

public Comparator comparator()
Description copied from interface: IndirectPriorityQueue
Returns the comparator associated with this queue, or null if it uses its elements' natural ordering.

Specified by:
comparator in interface IndirectPriorityQueue
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

secondaryComparator

public Comparator secondaryComparator()
Description copied from interface: IndirectDoublePriorityQueue
Returns the secondary comparator of this queue.

Specified by:
secondaryComparator in interface IndirectDoublePriorityQueue
Returns:
the secondary comparator of this queue.
See Also:
IndirectDoublePriorityQueue.secondaryFirst()