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

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

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

import com.landawn.abacus.util.function.LongFunction;
import com.annimon.stream.iterator.LsaIterator;
import com.annimon.stream.iterator.PrimitiveIterator;

public class LongMapToObj extends LsaIterator {

    private final PrimitiveIterator.OfLong iterator;
    private final LongFunction mapper;

    public LongMapToObj(PrimitiveIterator.OfLong iterator, LongFunction mapper) {
        this.iterator = iterator;
        this.mapper = mapper;
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy