package DataStructures; /** * A last-in-first-out (LIFO) stack of objects. * @param the type of elements held in this stack * @author Peter Williams */ public interface Stack { /** * Indicates the status of the stack. * @return true if the stack is empty. */ public boolean isEmpty(); /** * Pushes an item onto the stack. * @param item the item of type E to be pushed. */ public void push(E item); /** * Pops an item off the stack. * @return the item most recently pushed onto the stack * @exception NoSuchElementException if the stack is empty. */ public E pop(); }