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

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

The newest version!
package com.annimon.stream.operator;

import com.annimon.stream.function.Predicate;
import com.annimon.stream.iterator.LsaExtIterator;
import java.util.Iterator;

public class ObjTakeWhile extends LsaExtIterator {

    private final Iterator iterator;
    private final Predicate predicate;

    public ObjTakeWhile(Iterator iterator, Predicate 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