ai.timefold.jpyinterpreter.util.IteratorUtils Maven / Gradle / Ivy
package ai.timefold.jpyinterpreter.util;
import java.util.Iterator;
import java.util.function.Function;
import ai.timefold.jpyinterpreter.PythonLikeObject;
public class IteratorUtils {
public static Iterator iteratorMap(final Iterator source,
final Function mapFunction) {
return new Iterator() {
@Override
public boolean hasNext() {
return source.hasNext();
}
@Override
public PythonLikeObject next() {
return mapFunction.apply(source.next());
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy