com.annimon.stream.operator.LongTakeWhile Maven / Gradle / Ivy
The newest version!
package com.annimon.stream.operator;
import com.annimon.stream.function.LongPredicate;
import com.annimon.stream.iterator.PrimitiveExtIterator;
import com.annimon.stream.iterator.PrimitiveIterator;
public class LongTakeWhile extends PrimitiveExtIterator.OfLong {
private final PrimitiveIterator.OfLong iterator;
private final LongPredicate predicate;
public LongTakeWhile(PrimitiveIterator.OfLong iterator, LongPredicate 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