T
- the source value typeR
- the result value typepublic interface IxTransform<T,R>
If you need per consumer-state, wrap the parent operator with compose():
Ix.range(1, 10).compose(o -> {
int[] counter = { 0 };
return o.transform((it, c) -> {
if (it.hasNext()) {
it.next();
c.call(++counter[0]);
return NEXT;
}
return STOP;
});
});
Modifier and Type | Field and Description |
---|---|
static int |
LAST |
static int |
NEXT |
static int |
STOP |
Modifier and Type | Method and Description |
---|---|
int |
moveNext(java.util.Iterator<T> it,
IxConsumer<? super R> consumer) |
static final int STOP
static final int NEXT
static final int LAST
int moveNext(java.util.Iterator<T> it, IxConsumer<? super R> consumer)