java.lang

Interface SimpleIterator<T>

public interface SimpleIterator<T>

The iterator returned by Iterable, for use in the foreach statement.
Method Summary
booleanhasNext()
Returns true if the iteration has more elements.
Tnext()
Returns the next element in the iteration.

Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns: true if the iterator has more elements.

next

public T next()
Returns the next element in the iteration.

Returns: the next element in the iteration.

Throws: NoSuchElementException iteration has no more elements.