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

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

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

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

public class IntMap extends PrimitiveIterator.OfInt {

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

    public IntMap(PrimitiveIterator.OfInt iterator, IntUnaryOperator mapper) {
        this.iterator = iterator;
        this.mapper = mapper;
    }

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

    @Override
    public int nextInt() {
        return mapper.applyAsInt(iterator.nextInt());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy