/** * A simplified of the interface java.util.Stack. * This interface contains fewer methods, the * method specifications are simplified and the * elements of the stack are strings. * * @author Franck van Breugel */ public interface Stack { /** * Adds the given element to the top of this stack. * * @param element the element to be added to this stack. * @pre. element != null */ void push(String element); /** * Removes the element from the top of this stack and * returns it. * * @pre. !isEmpty() * @return the element at the top of this stack. */ String pop(); /** * Tests whether this stack is empty. * * @return true if this stack is empty, false otherwise. */ boolean isEmpty(); }