/** * Base interface for stack implementations * CSE326b project 2. * @version Wi08 */ public interface Stack { /** * Report whether the stack is empty * @return true if the stack has no elements */ public boolean isEmpty(); /** * Get the most recently inserted item in the stack. * Does not alter the stack. * * @return the most recently pushed item on the stack. * @exception EmptyStackException thrown if stack is empty. */ public E top(); /** * Remove the most recently inserted item from the stack. * @exception EmptyStackException thrown if stack is empty. */ public void pop(); /** * Push a new item onto the stack * @param x the item to insert. */ public void push( E x ); /** * Remove all elements from the stack. */ public void makeEmpty(); }