/** ****************************************************************************** * HOMEWORK 1, 15-211 ****************************************************************************** * Queue interface * * * @author V. Adamchik * @date 4/27/2007 * @see Queue ******************************************************************************/ /***************************************************************************** Do not modify this file. *****************************************************************************/ import java.util.*; public interface QueueInterface { /** * Tests if the queue is logically empty */ public boolean isEmpty(); /** * Puts a value into the back of the queue. It works with wraparound. * If the queue is full, tt doubles its size. * * @param value the item to insert. */ public void enqueue (AnyType value); /** * Returns the first element in the queue. * * @return element at front of the queue * @throws NoSuchElementException if the queue is empty. */ public AnyType getFront() throws java.util.NoSuchElementException; /** * Returns and removes the front element of the queuee. It works with wraparound. * * @return element at front of the queue * @throws NoSuchElementException if the queue is empty. */ public AnyType dequeue() throws java.util.NoSuchElementException; /** * Returns true if the specified value is in the Queue. * It runs at constant time, by using an auxillary hashtable. * * @return true if and only if the specified object is inthe Queue. */ public boolean contains(AnyType value); /** * Makes the queue physically empty. * */ public void clear(); /** * Obtains an Iterator object used to traverse the Queue from its front to back. * * @return an iterator. */ public Iterator iterator(); }