1 package annotations.util; 2 3 /** 4 * Stack that creates new stacks rather than modify data in place. 5 * 6 * @author dbro 7 * @param <E> type of stack elements 8 */ 9 public interface PersistentStack<E> { 10 public boolean isEmpty(); 11 public E peek(); 12 public PersistentStack<E> pop(); 13 public PersistentStack<E> push(E elem); 14 public int size(); 15 } 16