/** * Interface for a simple priority queue for objects with integer key values */ public interface PriorityQueue { /** * Return the size of this queue * @return the number of items inserted and not yet removed from the queue */ public int size(); /** * Insert a new item in the queue * @param value item to be inserted into the queue * @param key priority of this item */ public void insert(Object value, int key); /** * Return the item at the front of the queue without removing it * @return the item with the smallest priority in the queue */ public Object min(); /** * Remove the item at the front of the queue * @return the item with the smallest priority that was in the queue */ public Object removeMin(); /** * Change the priority of an item that is in the queue * @param value must be an object that is in the queue * @param newkey the new priority for this item */ public void replaceKey(Object value, int newkey); }