org.infinispan.stream.impl.intops.object.FlatMapToDoubleOperation Maven / Gradle / Ivy
package org.infinispan.stream.impl.intops.object;
import org.infinispan.stream.impl.intops.IntermediateOperation;
import java.util.function.Function;
import java.util.stream.DoubleStream;
import java.util.stream.Stream;
/**
* Performs flat map to double operation on a regular {@link Stream}
* @param the type of the input stream
*/
public class FlatMapToDoubleOperation implements IntermediateOperation, Double, DoubleStream> {
private final Function super I, ? extends DoubleStream> function;
public FlatMapToDoubleOperation(Function super I, ? extends DoubleStream> function) {
this.function = function;
}
@Override
public DoubleStream perform(Stream stream) {
return stream.flatMapToDouble(function);
}
public Function super I, ? extends DoubleStream> getFunction() {
return function;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy