previous | start | next

LinkListIterator's remove Method

private class LinkedListIterator implements ListIterator
   {  . . .
      public void remove()
      {
         if (position == first)
         {
            removeFirst();
            position = first;
         }
         else
         {
            if (previous == null)
               throw new IllegalStateException();
            previous.next = position.next;
            position = previous;
         }
         previous = null;
      }
      . . .
   }


previous | start | next