/** * A Queue is a repository for Objects maintained in first-in first-out order. * Objects are inserted using enqueue and removed using dequeue. * Objects are removed in the same order in which they are inserted. */ interface Queue { /** * Insert an Object in the queue. * * @param item the Object to be inserted */ void enqueue(Object item); /** * Remove an Object from the queue. * * @return the Object removed * @exception EmptyQueueException if the Queue is empty */ Object dequeue() throws EmptyQueueException; /** * Indicate whether or not the Queue is empty * * @return boolean indicating whether or not the Queue is empty */ boolean isEmpty(); }