Package ste.lloop
Class ArraySequence<T>
java.lang.Object
ste.lloop.AbstractSequence<IndexedSequence<T>>
ste.lloop.IndexedSequence<T>
ste.lloop.ArraySequence<T>
- Type Parameters:
T- the type of the elements in the array
A sequence that loops over an array.
-
Field Summary
Fields inherited from class ste.lloop.AbstractSequence
indexes -
Constructor Summary
Constructors -
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.IndexedSequence
loopMethods inherited from class ste.lloop.AbstractSequence
from, step, to
-
Constructor Details
-
ArraySequence
Creates a new sequence for the given array.- Parameters:
array- the array to loop over
-
-
Method Details
-
loop
Description copied from class:IndexedSequenceExecutes the given consumer for each element in the loop.If the array provided to the constructor was
null, this method will do nothing.- Specified by:
loopin classIndexedSequence<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.brk(Object), ornullif the loop completes without abrk
-