Package ste.lloop
Class MapSequence<K,V>
- Type Parameters:
K- the type of the keys in the mapV- the type of the values in the map
A sequence that loops over a map.
-
Field Summary
Fields inherited from class ste.lloop.AbstractSequence
indexes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Rloop(BiConsumer<K, V> consumer) Executes the given consumer for each element in the loop.<R> Rloop(MapLoopConsumer<K, V> consumer) Executes the given consumer for each element in the loop.Methods inherited from class ste.lloop.AbstractSequence
from, step, to
-
Constructor Details
-
MapSequence
Creates a new sequence for the given map.- Parameters:
map- the map to loop over
-
-
Method Details
-
loop
Executes the given consumer for each element in the loop.If the map provided to the constructor was
null, this method will do nothing.- 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
-
loop
Executes the given consumer for each element in the loop.If the map provided to the constructor was
null, this method will do nothing.- 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
-