public Stream < T > onNext ( final Action1 < ? super T > action ) { return new Stream < T > ( ) { @ Override public Iterator < T > iterator ( ) { return new ReadOnlyIterator < T > ( ) { Iterator < T > iterator = Stream . this . iterator ( ) ; @ Override public boolean hasNext ( ) { return iterator . hasNext ( ) ; } @ Override public T next ( ) { final T next = iterator . next ( ) ; action . call ( next ) ; return next ; } } ; } } ; }
Executes an action for each item in the stream .