Class IteratorSequence<T>
java.lang.Object
ste.lloop.AbstractSequence<ForwardOnlySequence<T>, T>
ste.lloop.ForwardOnlySequence<T>
ste.lloop.IteratorSequence<T>
- Type Parameters:
T- the type of the elements in the iterator
A sequence that loops over an iterator and can only go forward.
-
Field Summary
Fields inherited from class ste.lloop.AbstractSequence
indexes -
Constructor Summary
ConstructorsConstructorDescriptionIteratorSequence(Iterator<T> iterator) Creates a new sequence for the given iterator. -
Method Summary
Modifier and TypeMethodDescription<R> Rloop(BiConsumer<Integer, T> consumer) Executes the given consumer for each element in the loop.Methods inherited from class ste.lloop.ForwardOnlySequence
from, loop, step, to
-
Constructor Details
-
IteratorSequence
-
-
Method Details
-
loop
Executes the given consumer for each element in the loop.If the iterator provided to the constructor was
null, this method will do nothing.- Specified by:
loopin classForwardOnlySequence<T>- Type Parameters:
R- the type of the return value- Parameters:
consumer- the consumer to execute for each element- Returns:
- the value passed to
Loop._break_(Object...), ornullif the loop completes without a_break_
-