/**
 * Sequence
 * 
 * Synopsis: defines the interface to the ADT "sequences of objects."
 * Author:   Dave Small 
 * History:  v1.0 - 9801.09 created
 *           v1.1 - 9801.11 finalized (hopefully!) specification
 *           ...simplified, A. Crummer removed some methods 1/12/98
 */

public interface Sequence
{
  // Add data to a Sequence                         

  public void pushHead( Object item );            // insert item to front (position 1) 
  public void pushTail( Object item );            // append item to end of sequence
  public void putAt( Object item, int position ); // insert item, following items will
                                                  // advance positions
  
  // Read data in a Sequence

  public Object head();                           // get the head object
  public Object tail();                           // get the tail object
  public Object itemAt( int position );           // get object at position
      
  // Remove data from a Sequence

  public Object  popHead();                       // remove and return head
  public Object  popTail();                       // remove and return tail
  public Object  remove( int position );          // remove item in specified  position
  public void    clear();

  // Utility functions

  public int      length();                       // return # items in seq
  public boolean  isEmpty();                      //true iff length == 0

  public String   toString();                     // return a string
                                                  // representing the object

}