public class StackSLL { SimpleLinkedList lista = new SimpleLinkedList(); public StackSLL() { } public StackSLL(SimpleLinkedList lista) { super(); this.lista = lista; } public boolean empty() { return this.lista.size() <= 0; } public ELEMENT peek() { if (this.empty()) { throw new RuntimeException("La pila está vacía..."); } return this.lista.element(); } public ELEMENT pop() { if (this.empty()) { throw new RuntimeException("La pila está vacía..."); } return this.lista.removeFirst(); } public ELEMENT push(ELEMENT element) { lista.addFirst(element); return this.lista.element(); } public boolean search(Object object) { return lista.search(object); } public int size() { return this.lista.size(); } public String toString() { return this.lista.toString(); } }