pqueue
Interface AdaptablePriorityQueue

All Superinterfaces:
PriorityQueue

public interface AdaptablePriorityQueue
extends PriorityQueue

Extends the priority queue interface to support removal and reprioritization of elements. To implement this interface efficiently, you will need a location-aware implementation of entries (so that you can restore the heap property after such changes).


Method Summary
 container.Entry remove(container.Entry e)
          Remove an entry, and return that entry (for convenience).
 java.lang.Object replaceKey(container.Entry e, java.lang.Object key)
          Replace the key of the given entry.
 java.lang.Object replaceValue(container.Entry e, java.lang.Object value)
          Replace the value of the given entry.
 
Methods inherited from interface pqueue.PriorityQueue
insert, isEmpty, min, removeMin, size
 

Method Detail

remove

public container.Entry remove(container.Entry e)
                       throws InvalidEntryException
Remove an entry, and return that entry (for convenience). Note that you can say, for example, Entry e = pq.remove(pq.min()) which is equivalent to Entry e = pq.removeMin();

InvalidEntryException

replaceKey

public java.lang.Object replaceKey(container.Entry e,
                                   java.lang.Object key)
                            throws InvalidEntryException,
                                   InvalidKeyException
Replace the key of the given entry. Return the old key, for convenience.

InvalidEntryException
InvalidKeyException

replaceValue

public java.lang.Object replaceValue(container.Entry e,
                                     java.lang.Object value)
                              throws InvalidEntryException
Replace the value of the given entry. Return the old value, for convenience.

InvalidEntryException