it.unimi.dsi.fastutil
Class AbstractIndirectPriorityQueue

java.lang.Object
  extended byit.unimi.dsi.fastutil.AbstractIndirectPriorityQueue
All Implemented Interfaces:
IndirectPriorityQueue
Direct Known Subclasses:
AbstractIndirectDoublePriorityQueue, ByteArrayIndirectPriorityQueue, ByteHeapSemiIndirectPriorityQueue, CharArrayIndirectPriorityQueue, CharHeapSemiIndirectPriorityQueue, DoubleArrayIndirectPriorityQueue, DoubleHeapSemiIndirectPriorityQueue, FloatArrayIndirectPriorityQueue, FloatHeapSemiIndirectPriorityQueue, IndirectPriorityQueues.EmptyIndirectPriorityQueue, IntArrayIndirectPriorityQueue, IntHeapSemiIndirectPriorityQueue, LongArrayIndirectPriorityQueue, LongHeapSemiIndirectPriorityQueue, ObjectArrayIndirectPriorityQueue, ObjectHeapSemiIndirectPriorityQueue, ShortArrayIndirectPriorityQueue, ShortHeapSemiIndirectPriorityQueue

public abstract class AbstractIndirectPriorityQueue
extends Object
implements IndirectPriorityQueue

An abstract class providing basic methods for implementing the IndirectPriorityQueue interface.

This class defines changed(int), allChanged(), remove(int) and last() as throwing an UnsupportedOperationException.


Constructor Summary
AbstractIndirectPriorityQueue()
           
 
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 index)
          Notifies the queue that the specified element has changed (optional operation).
 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 index)
          Removes the specified element from the queue (optional operation).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.IndirectPriorityQueue
clear, comparator, dequeue, enqueue, first, size
 

Constructor Detail

AbstractIndirectPriorityQueue

public AbstractIndirectPriorityQueue()
Method Detail

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.

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

changed

public void changed(int index)
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:
index - the element that has changed.

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

remove

public void remove(int index)
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:
index - the element to be removed.

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.