public boolean hayAnterior() { boolean hayAnterior = false; if (nodoActual != null) hayAnterior = nodoActual.darAnterior() != null; else if (ultimo != null) hayAnterior = true; return hayAnterior; }
public T darAnterior() { T elemento = null; if (hayAnterior()) { if (nodoActual != null) { nodoActual = nodoActual.darAnterior(); elemento = nodoActual.darElemento(); } else if (ultimo != null) { nodoActual = ultimo; elemento = nodoActual.darElemento(); } } return elemento; }