/**
 * A queue of Objects.
 *
 * @author Blanca Polo
 * @version 21 Oct 2003
 */

public interface Queue{


  /**
   * Determines whether or not the queue is empty.
   * 
   * @return true if there are no elements in the queue (size() == 0),
   *    otherwise returns false.
   */

  public boolean isEmpty();
  
  /**
   * Returns the size of the queue.
   *
   * @return the number of elements in the queue
   */
  public int size();

  
  /**
   * Enqueues (adds) an element to the back of the queue
   * @param item   Object to add
   */
  public void enqueue(Object item);


  /**
   * Dequeues (removes) an item from the front of the queue.
   * @throws QueueException  if the object cannot be removed
   */
  public Object dequeue ( ) throws QueueException;


  /**
   * Returns the element in the front of the queue.
   *  (or null if there is no such element).   
   * Does NOT remove the Object or affect the list.
   */
  public Object peek ( );


  /**
   * Removes all elements from the queue
   * and "prints" them as they are dequeued.
   * @return  a String representing all the items removed from the queue
   */
  public String dequeueAndPrint () throws QueueException;
  
  
  /**
   * Removes all elements from the queue
   * size() is then 0.
   */
  public void dequeueAll ();

  
}//end interface

