All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.annimon.stream.operator.DoubleTakeWhile Maven / Gradle / Ivy

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 DoubleTakeWhile extends PrimitiveExtIterator.OfDouble {

    private final PrimitiveIterator.OfDouble iterator;
    private final DoublePredicate predicate;

    public DoubleTakeWhile(PrimitiveIterator.OfDouble iterator, DoublePredicate 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