com.annimon.stream.operator.IntMapToDouble Maven / Gradle / Ivy
The newest version!
package com.annimon.stream.operator;
import com.landawn.abacus.util.function.IntToDoubleFunction;
import com.annimon.stream.iterator.PrimitiveIterator;
public class IntMapToDouble extends PrimitiveIterator.OfDouble {
private final PrimitiveIterator.OfInt iterator;
private final IntToDoubleFunction mapper;
public IntMapToDouble(PrimitiveIterator.OfInt iterator, IntToDoubleFunction mapper) {
this.iterator = iterator;
this.mapper = mapper;
}
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public double nextDouble() {
return mapper.applyAsDouble(iterator.nextInt());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy