Source of 13.5.java


  1: // @author Frank M. Carrano, Timothy M. Henry
  2: // @version 5.0
  3: public T next()
  4: {
  5:    if (hasNext())
  6:    {
  7:       wasNextCalled = true;
  8:       nextPosition++;
  9:       return list.getEntry(nextPosition);
 10:    }
 11:    else
 12:       throw new NoSuchElementException("Illegal call to next(); " +
 13:                                        "iterator is after end of list.");
 14: } // end next