1: // @author Frank M. Carrano, Timothy M. Henry 2: // @version 5.0 3: public T next() 4: { 5: if (hasNext()) 6: { 7: lastMove = Move.NEXT; 8: isRemoveOrSetLegal = true; 10: T nextEntry = list[nextIndex]; 11: nextIndex++; // Advance iterator 13: return nextEntry; 14: } 15: else 16: throw new NoSuchElementException("Illegal call to next(); " + 17: "iterator is after end of list."); 18: } // end next