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> { isEmpty()10 public boolean isEmpty(); peek()11 public E peek(); pop()12 public PersistentStack<E> pop(); push(E elem)13 public PersistentStack<E> push(E elem); size()14 public int size(); 15 } 16