package lists; /* * A Stack is a "first-in, last-out" (FILO) structure where new * elements are inserted in such a way that the element that can * be removed is the one that was added last. * * A stack supports the following methods: * * isEmpty - returns true if stack is empty * isFull - returns true if stack is full * getSize - returns the number of nodes in the stack * push - adds an object to the top of a stack * pop - returns top element from the stack and removes it * peek - returns top element from stack without removing it */ public interface ADTStack { /* * */ public abstract boolean isEmpty(); /* * */ public abstract boolean isFull(); /* * */ public abstract int getSize(); /* * */ public abstract void push(Object obj); /* * */ public abstract Object pop(); /* * */ public abstract Object peek(); }