com.annimon.stream.operator.ObjScan Maven / Gradle / Ivy
The newest version!
package com.annimon.stream.operator;
import com.landawn.abacus.util.function.BiFunction;
import com.annimon.stream.iterator.LsaExtIterator;
import java.util.Iterator;
public class ObjScan extends LsaExtIterator {
private final Iterator extends T> iterator;
private final BiFunction accumulator;
public ObjScan(Iterator extends T> iterator, BiFunction accumulator) {
this.iterator = iterator;
this.accumulator = accumulator;
}
@Override
protected void nextIteration() {
hasNext = iterator.hasNext();
if (hasNext) {
final T value = iterator.next();
if (isInit) {
next = accumulator.apply(next, value);
} else {
next = value;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy