@ Override public Iterator < T > iterator ( ) { return new Iterator < T > ( ) { private int cursor = 0 ; @ Override public boolean hasNext ( ) { return size == INFINITE_SIZE || cursor < size ; } @ Override public T next ( ) { if ( ! hasNext ( ) ) { throw new NoSuchElementException ( ) ; } cursor ++ ; return generator . next ( ) ; } @ Override public void remove ( ) { throw new UnsupportedOperationException ( "remove() operation is not supported" ) ; } } ; }
Provides iterator over this iterable