/**
 * The Stack interface specifies a collection of elements that are added
 * and removed according to the last-in-first-out principle.
 *
 * @version	1.2    May 4, 2000
 * @author	Franck van Breugel
 */
public interface Stack 
{

    /** 
     * Returns the size of this stack. 
     * @return The size of this stack.
     */
    public int size();

    /** 
     * Tests if this stack is empty. 
     * @return true if this stack is empty, false otherwise.
     */
    public boolean isEmpty();

    /** 
     * Returns the element at the top of this stack.
     * Throws a StackEmptyException if this stack is empty. 
     * @return The element at the top of this stack.
     * @exception StackEmptyException if this stack is empty. 
     */
    public Object top() throws StackEmptyException;

    /** 
     * Adds the specified element onto the top of this stack. 
     * @param element the element to be added to this stack.
     **/
    public void push(Object element);

    /** 
     * Removes the element at the top of this stack and returns that element.
     * Throws a StackEmptyException if this stack is empty. 
     * @return The element at the top of this stack.
     * @exception StackEmptyException if this stack is empty. 
     */
    public Object pop() throws StackEmptyException;
}



