/** * Base interface for queue implementations. */ public interface Queue { /** * Returns true if queue has no elements * * @return true if the queue has no elements */ public boolean isEmpty(); /** * Enqueues a new object to the queue * * @param x Object to be enqueued into the queue. */ public void enqueue(Object x); /** * Get the least recently inserted item in the queue. * Does not alter the queue. * * @return The front of the queue. * @exception UnderflowException Thrown if queue is empty. */ public Object peek(); /** * dequeues the front of the queue. * * @return The front of the queue. * @exception UnderflowException Thrown if queue is empty. */ public Object dequeue(); /** * Erases all elements from the queue. */ public void makeEmpty(); }