Please send questions to
st10@humboldt.edu .
/* Cs132Stack.java 1.0 (interface) */
/* by Sharon Tuttle */
/* last modified: 3-11-03 */
public interface Cs132Stack
{
// Purpose: returns true iff stack has no elements
public boolean isEmpty();
// Purpose: add given data newElement to top of stack
public void push(Object newElement);
// Purpose: IF stack is not empty, REMOVE element from top
// of stack and return it
// If it IS empty, throw a StackEmptyException.
public Object pop() throws StackEmptyException;
// Purpose: IF stack is not empty, return (NONDESTRUCTIVELY) the
// top element of the stack.
// If it IS empty, throw a StackEmptyException
public Object getTop() throws StackEmptyException;
}