com.github.basking2.sdsai.itrex.functions.PrintArgsFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdsai-itrex Show documentation
Show all versions of sdsai-itrex Show documentation
An S-Expression inspiried library focused on iterators.
package com.github.basking2.sdsai.itrex.functions;
import com.github.basking2.sdsai.itrex.EvaluationContext;
import java.io.PrintStream;
import java.util.Iterator;
import static com.github.basking2.sdsai.itrex.iterators.Iterators.mapIterator;
public class PrintArgsFunction implements FunctionInterface> {
final private PrintStream out;
public PrintArgsFunction(PrintStream out) {
this.out = out;
};
@Override
public Iterator> apply(final Iterator> iterator, final EvaluationContext evaluationContext) {
return mapIterator(iterator, arg -> {
out.println(arg +":"+arg.getClass());
return arg;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy