/* * CS220_Stack_Interface.java * * Created on Jun 4, 2007 * * by Donald Yessick */ /** * CS220_Stack_Interface * @author Donald Yessick * @ */ public interface CS220_Stack_Interface { /** * isEmpty returns the stack status * @return true if the stack has no objects */ boolean isEmpty(); /** * getCount provides the number of objects stored in the stack * @return number of objects in stack */ int getCount(); /** * push adds an item to the stack * @param object to be added */ void push(Object object); /** * pop removes the top item on the stack * @return the object at top */ Object pop(); /** * peek fetches the top object on the stack * @return the object at top */ Object peek(); /** * visit each element using the visitor design pattern * visit * @param v the visitor implementing a visit(object) method */ void visit(CS220_Visitor_Interface v); }