// file: PriorityQueue.java // author: Robert Keller // purpose: Define a PriorityQueue interface. /** * A Priority is a repository for Objects that can be compared using * a Comparator. * Objects are inserted using enqueue and removed using dequeueMin, * which always returns the minimum based on the Comparator. */ interface PriorityQueue { /** * Insert an Comparable in the PriorityQueue. * * @param item the Comparable to be inserted */ void enqueue(Object item); /** * Remove the minimum Comparable from the PriorityQueue. * * @return the Comparable removed * @exception EmptyQueueException if the PriorityQueue is empty */ Object dequeueMin() throws EmptyQueueException; /** * Indicate whether or not the PriorityQueue is empty * * @return boolean indicating whether or not the Queue is empty */ boolean isEmpty(); }