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 extends T> iterator;
private final Function super T, ? extends R> mapper;
public ObjMap(Iterator extends T> iterator, Function super T, ? extends R> 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