public class SortedListAdaptablePriorityQueue<K,V> extends SortedListPriorityQueue<K,V> implements AdaptablePriorityQueue<K,V>
Constructor and Description |
---|
SortedListAdaptablePriorityQueue()
Creates the priority queue with the default comparator
|
SortedListAdaptablePriorityQueue(java.util.Comparator<K> comp)
Creates the priority queue with the given comparator
|
SortedListAdaptablePriorityQueue(PositionList<Entry<K,V>> list,
java.util.Comparator<K> comp)
Creates the priority queue with the given comparator and list.
|
Modifier and Type | Method and Description |
---|---|
Entry<K,V> |
insert(K k,
V v)
Inserts a key-value pair and returns the entry created
|
Entry<K,V> |
remove(Entry<K,V> entry)
Removes and returns the given entry
|
K |
replaceKey(Entry<K,V> entry,
K k)
Replaces the key of the given entry
|
V |
replaceValue(Entry<K,V> e,
V value)
Replaces the value of the given entry
|
isEmpty, min, removeMin, setComparator, size, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
isEmpty, min, removeMin, size
public SortedListAdaptablePriorityQueue()
public SortedListAdaptablePriorityQueue(java.util.Comparator<K> comp)
public SortedListAdaptablePriorityQueue(PositionList<Entry<K,V>> list, java.util.Comparator<K> comp)
public Entry<K,V> insert(K k, V v) throws InvalidKeyException
insert
in interface PriorityQueue<K,V>
insert
in class SortedListPriorityQueue<K,V>
InvalidKeyException
public Entry<K,V> remove(Entry<K,V> entry)
remove
in interface AdaptablePriorityQueue<K,V>
public K replaceKey(Entry<K,V> entry, K k)
replaceKey
in interface AdaptablePriorityQueue<K,V>
public V replaceValue(Entry<K,V> e, V value)
replaceValue
in interface AdaptablePriorityQueue<K,V>