/** * An interface for the Priority Queue ADT. Note that relative priority of * elements is determined with the T.compareTo() method. * @param the type of data the queue stores. * @author Jadrian Miles */ public interface PriorityQueue> { /** Adds the given item to the queue. */ public void add(T item); /** Removes the maximum item from the queue, and returns it. * @return null if the queue is empty. */ public T remove(); /** Returns the maximum item in the queue, without removing it. * @return null if the queue is empty. */ public T peek(); /** Returns true if the queue is empty. */ public boolean isEmpty(); /** Removes all items from the queue. */ public void clear(); }