public abstract class AbstractIndirectPriorityQueue<K> extends Object implements IndirectPriorityQueue<K>
IndirectPriorityQueue
interface.
This class defines changed(int)
, allChanged()
, remove(int)
and last()
as throwing an
UnsupportedOperationException
.
Constructor and Description |
---|
AbstractIndirectPriorityQueue() |
Modifier and Type | Method and Description |
---|---|
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).
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, comparator, dequeue, enqueue, first, front, size
public int last()
IndirectPriorityQueue
last
in interface IndirectPriorityQueue<K>
public void changed()
IndirectPriorityQueue
changed
in interface IndirectPriorityQueue<K>
public void changed(int index)
IndirectPriorityQueue
Note that the specified element must belong to this queue.
changed
in interface IndirectPriorityQueue<K>
index
- the element that has changed.public void allChanged()
IndirectPriorityQueue
allChanged
in interface IndirectPriorityQueue<K>
public boolean remove(int index)
IndirectPriorityQueue
remove
in interface IndirectPriorityQueue<K>
index
- the element to be removed.public boolean contains(int index)
IndirectPriorityQueue
contains
in interface IndirectPriorityQueue<K>
index
- an index possibly in the queue.public boolean isEmpty()
IndirectPriorityQueue
isEmpty
in interface IndirectPriorityQueue<K>