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

    return data;
  }