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

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

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

import com.annimon.stream.function.DoubleFunction;
import com.annimon.stream.iterator.LsaIterator;
import com.annimon.stream.iterator.PrimitiveIterator;

public class DoubleMapToObj extends LsaIterator {

    private final PrimitiveIterator.OfDouble iterator;
    private final DoubleFunction mapper;

    public DoubleMapToObj(PrimitiveIterator.OfDouble iterator, DoubleFunction mapper) {
        this.iterator = iterator;
        this.mapper = mapper;
    }

    @Override
    public boolean hasNext() {
        return iterator.hasNext();
    }

    @Override
    public R nextIteration() {
        return mapper.apply(iterator.nextDouble());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy