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

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

package com.annimon.stream.operator;

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

public class IntMapToObj extends LsaIterator {

    private final PrimitiveIterator.OfInt iterator;
    private final IntFunction mapper;

    public IntMapToObj(PrimitiveIterator.OfInt iterator, IntFunction mapper) {
        this.iterator = iterator;
        this.mapper = mapper;
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy