package DataStructures; /** * Interface for a priority queue of elements of type E.

* *

* Elements of type E must implement the Comparable interface * in their defining class or in some superclass. *

* * The remove method returns an item of highest priority from * the queue. * If distinct items are of the same priority, an implementation is * not obliged to return them in any particular order, unless it * declares otherwise.

* * @see Comparable * @param the type of elements held in this queue * @author Peter Williams */ public interface PriorityQueue> { /** * Indicates the status of the queue. * @return true if the queue is empty. */ public boolean isEmpty(); /** * Returns the current size of the queue * @return the current size of the queue */ public int size(); /** * Adds an item to the queue. * @param item the item to be added. */ public void add(E item); /** * Removes an item of highest priority from the queue. * @return an item of highest priority. * @throws NoSuchElementException if the queue is empty. */ public E remove(); }