/* * File: ZHStack.java */ package zhstructures; /** * Interface for a stack class * * @author J. Andrew Holey * @version August 7, 2008 */ public interface ZHStack extends ZHCollection { /** * Returns the top element of this stack without removing it. * * @return the top element of this stack * @throws NoSuchElementException if this stack is empty */ public ElementType peek(); /** * Removes and returns the top element of this stack. * * @return the top element of this stack * @throws NoSuchElementException if this stack is empty */ public ElementType pop(); /** * Adds a new element to the top of this stack. * * @param element the element to be added */ public void push(ElementType element); }