it.unimi.dsi.fastutil
Class AbstractIndirectPriorityQueue<K>

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

public abstract class AbstractIndirectPriorityQueue<K>
extends Object
implements IndirectPriorityQueue<K>

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 this queue that the all elements have changed (optional operation).
 void changed()
          Notifies this queue that the first element has changed (optional operation).
 void changed(int index)
          Notifies this queue that the specified element has changed (optional operation).
 boolean contains(int index)
          Checks whether a given index belongs to this queue (optional operation).
 boolean isEmpty()
          Checks whether this queue is empty.
 int last()
          Returns the last element of this queue, that is, the element the would be dequeued last (optional operation).
 boolean remove(int index)
          Removes the specified element from this 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, front, size
 

Constructor Detail

AbstractIndirectPriorityQueue

public AbstractIndirectPriorityQueue()
Method Detail

last

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

Specified by:
last in interface IndirectPriorityQueue<K>
Returns:
the last element.

changed

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

Specified by:
changed in interface IndirectPriorityQueue<K>

changed

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

Note that the specified element must belong to this queue.

Specified by:
changed in interface IndirectPriorityQueue<K>
Parameters:
index - the element that has changed.

allChanged

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

Specified by:
allChanged in interface IndirectPriorityQueue<K>

remove

public boolean remove(int index)
Description copied from interface: IndirectPriorityQueue
Removes the specified element from this queue (optional operation).

Specified by:
remove in interface IndirectPriorityQueue<K>
Parameters:
index - the element to be removed.
Returns:
true if the index was in the queue.

contains

public boolean contains(int index)
Description copied from interface: IndirectPriorityQueue
Checks whether a given index belongs to this queue (optional operation).

Specified by:
contains in interface IndirectPriorityQueue<K>
Returns:
true if the specified index belongs to this queue.

isEmpty

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

Specified by:
isEmpty in interface IndirectPriorityQueue<K>
Returns:
true if this queue is empty.