com.annimon.stream.operator.DoubleDropWhile Maven / Gradle / Ivy
The newest version!
package com.annimon.stream.operator;
import com.landawn.abacus.util.function.DoublePredicate;
import com.annimon.stream.iterator.PrimitiveExtIterator;
import com.annimon.stream.iterator.PrimitiveIterator;
public class DoubleDropWhile extends PrimitiveExtIterator.OfDouble {
private final PrimitiveIterator.OfDouble iterator;
private final DoublePredicate predicate;
public DoubleDropWhile(PrimitiveIterator.OfDouble iterator, DoublePredicate predicate) {
this.iterator = iterator;
this.predicate = predicate;
}
@Override
protected void nextIteration() {
if (!isInit) {
// Skip first time
while (hasNext = iterator.hasNext()) {
next = iterator.next();
if (!predicate.test(next)) {
return;
}
}
}
hasNext = hasNext && iterator.hasNext();
if (!hasNext) return;
next = iterator.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy