/** * Get the next element. * @return the next element. * @throws NoSuchElementException if there are no more elements. */ public Object next() throws NoSuchElementException { checkCurrent() ; if (current == null) { throw new NoSuchElementException("No more elements in iterator") ; } final Object result = current ; current = null ; return result ; }
/** * Get the next element. * @return the next element. * @throws NoSuchElementException if there are no more elements. */ public Object next() throws NoSuchElementException { checkCurrent() ; if (current == null) { throw new NoSuchElementException("No more elements in iterator") ; } final Object result = current ; current = null ; return result ; }
/** * Get the next element. * @return the next element. * @throws NoSuchElementException if there are no more elements. */ public Object next() throws NoSuchElementException { checkCurrent() ; if (current == null) { throw new NoSuchElementException("No more elements in iterator") ; } final Object result = current ; current = null ; return result ; }
/** * Are there any more elements? * @return true if the iterator has more elements, false otherwise. */ public boolean hasNext() { checkCurrent() ; return (current != null) ; }
/** * Are there any more elements? * @return true if the iterator has more elements, false otherwise. */ public boolean hasNext() { checkCurrent() ; return (current != null) ; }
/** * Are there any more elements? * @return true if the iterator has more elements, false otherwise. */ public boolean hasNext() { checkCurrent() ; return (current != null) ; }