com.annimon.stream.operator.IntTakeWhile Maven / Gradle / Ivy
package com.annimon.stream.operator;
import com.landawn.abacus.util.function.IntPredicate;
import com.annimon.stream.iterator.PrimitiveExtIterator;
import com.annimon.stream.iterator.PrimitiveIterator;
public class IntTakeWhile extends PrimitiveExtIterator.OfInt {
private final PrimitiveIterator.OfInt iterator;
private final IntPredicate predicate;
public IntTakeWhile(PrimitiveIterator.OfInt iterator, IntPredicate predicate) {
this.iterator = iterator;
this.predicate = predicate;
}
@Override
protected void nextIteration() {
hasNext = iterator.hasNext()
&& predicate.test(next = iterator.next());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy