public boolean hasNext() { boolean val = true; if (currentNode.getNext() == null) { val = false; } return val; // if we have no dummy node, return currentNode == null }
public void remove() { currentNode = currentNode.getNext(); }
public E next() { E data = (E) currentNode.getData(); currentNode = currentNode.getNext(); return data; }