All Downloads are FREE. Search and download functionalities are using the official Maven repository.

functionalj.stream.DoubleStreamProcessor Maven / Gradle / Ivy

package functionalj.stream;

import static functionalj.lens.Access.theDouble;

import java.util.function.ToDoubleFunction;

import lombok.val;

public interface DoubleStreamProcessor {
    
    public TARGET process(DoubleStreamPlus stream);
    
    
    default StreamProcessor ofDouble() {
        return of(theDouble);
    }
    default  StreamProcessor of(ToDoubleFunction mapper) {
        return new StreamProcessor() {
            @Override
            public TARGET process(StreamPlus stream) {
                val dataStream = stream.mapToDouble(mapper);
                val target     = DoubleStreamProcessor.this.process(dataStream);
                return target;
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy