kactoos-jvm / nnl.rocks.kactoos.scalar / AndWithIndex / <init>
AndWithIndex(vararg src:
Func
<
Int
,
Boolean
>)
src
- The iterableAndWithIndex(iterable:
Iterable
<
Func
<
Int
,
Boolean
>>)
Logical conjunction, with index.
This class can be effectively used to iterate through a collection, just like java.util.stream.Stream.forEach works, but with an index provided for each item:
new And(
new IterableOf("Mary", "John", "William", "Napkin"),
new BiFuncOf<>(
(text, index) -> System.out.printf("Name #%d: %s\n", index, text),
true
)
).value();
There is no thread-safety guarantee.
iterable
- The iterable
Since 0.4