jdsl
Class SequenceSimplePriorityQueue
java.lang.Object
|
+--jdsl.SequenceSimplePriorityQueue
- Direct Known Subclasses:
- SequenceLocPriorityQueue
- public class SequenceSimplePriorityQueue
- extends java.lang.Object
- implements SimplePriorityQueue
Implementation of a priority queue using a sorted sequence
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
seq
protected Sequence seq
comp
protected Comparator comp
SequenceSimplePriorityQueue
public SequenceSimplePriorityQueue(Comparator c)
extractKey
protected java.lang.Object extractKey(Position pos)
extractElem
protected java.lang.Object extractElem(Position pos)
extractElem
protected java.lang.Object extractElem(java.lang.Object kep)
size
public int size()
isEmpty
public boolean isEmpty()
insertItem
public void insertItem(java.lang.Object k,
java.lang.Object e)
throws InvalidKeyException
- Specified by:
- insertItem in interface SimplePriorityQueue
minElement
public java.lang.Object minElement()
throws EmptyContainerException
- Specified by:
- minElement in interface SimplePriorityQueue
minKey
public java.lang.Object minKey()
throws EmptyContainerException
- Specified by:
- minKey in interface SimplePriorityQueue
removeMinElement
public java.lang.Object removeMinElement()
throws EmptyContainerException
- Specified by:
- removeMinElement in interface SimplePriorityQueue
newContainer
public Container newContainer()
- Make a new container of this type using the same Comparator
elements
public java.util.Iterator elements()
- Returns an iterator of the elements in this sequence