Class CharacterSequence
A sequence that loops over a CharSequence. Note that we do not reuse
ArraySequence to work directly on the sequence itself, not on char[]
extracted from it.
-
Field Summary
Fields inherited from class ste.lloop.AbstractSequence
indexes -
Constructor Summary
ConstructorsConstructorDescriptionCharacterSequence(CharSequence sequence) Creates a new sequence for the given CharSequence. -
Method Summary
Modifier and TypeMethodDescription<R> Rloop(BiConsumer<Integer, Character> 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
-
CharacterSequence
Creates a new sequence for the given CharSequence.- Parameters:
sequence- the CharSequence 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<Character>- 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_
-