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

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

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

import com.landawn.abacus.util.function.Function;
import com.annimon.stream.iterator.LsaIterator;
import java.util.Iterator;

public class ObjMap extends LsaIterator {

    private final Iterator iterator;
    private final Function mapper;

    public ObjMap(Iterator iterator, Function mapper) {
        this.iterator = iterator;
        this.mapper = mapper;
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy