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

functionalj.stream.StreamableWithSplit Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
package functionalj.stream;

import java.util.function.Predicate;

import functionalj.list.FuncList;
import functionalj.map.FuncMap;
import functionalj.tuple.Tuple2;
import functionalj.tuple.Tuple3;
import functionalj.tuple.Tuple4;
import functionalj.tuple.Tuple5;
import functionalj.tuple.Tuple6;

public interface StreamableWithSplit
    extends StreamableWithMapTuple {
    
    
    public StreamPlus stream();
    
    
    //== split ==
    // Lazy
    
    public default Tuple2, FuncList> split(
            Predicate predicate) {
        return stream()
                .split(predicate);
    }
    
    public default Tuple3, FuncList, FuncList> split(
            Predicate predicate1,
            Predicate predicate2) {
        return stream()
                .split(predicate1, predicate2);
    }
    
    public default Tuple4, FuncList, FuncList, FuncList> split(
            Predicate predicate1,
            Predicate predicate2,
            Predicate predicate3) {
        return stream()
                .split(predicate1, predicate2, predicate3);
    }
    
    public default Tuple5, FuncList, FuncList, FuncList, FuncList> split(
            Predicate predicate1,
            Predicate predicate2,
            Predicate predicate3,
            Predicate predicate4) {
        return stream()
                .split(predicate1, predicate2, predicate3, predicate4);
    }
    
    public default Tuple6, FuncList, FuncList, FuncList, FuncList, FuncList> split(
            Predicate predicate1,
            Predicate predicate2,
            Predicate predicate3,
            Predicate predicate4,
            Predicate predicate5) {
        return stream()
                .split(predicate1, predicate2, predicate3, predicate4, predicate5);
    }
    
    public default  FuncMap> split(
            KEY key1, Predicate predicate,
            KEY key2) {
        return stream()
                .split(key1, predicate,
                       key2);
    }
    
    public default  FuncMap> split(
            KEY key1, Predicate predicate1,
            KEY key2, Predicate predicate2,
            KEY key3) {
        return stream()
                .split(key1, predicate1,
                       key2, predicate2,
                       key3);
    }
    
    public default  FuncMap> split(
            KEY key1, Predicate predicate1,
            KEY key2, Predicate predicate2,
            KEY key3, Predicate predicate3,
            KEY key4) {
        return stream()
                .split(key1, predicate1,
                       key2, predicate2,
                       key3, predicate3,
                       key4);
    }
    
    public default  FuncMap> split(
            KEY key1, Predicate predicate1,
            KEY key2, Predicate predicate2,
            KEY key3, Predicate predicate3,
            KEY key4, Predicate predicate4,
            KEY key5) {
        return stream()
                .split(key1, predicate1,
                       key2, predicate2,
                       key3, predicate3,
                       key4, predicate4,
                       key5);
    }
    
    public default  FuncMap> split(
            KEY key1, Predicate predicate1,
            KEY key2, Predicate predicate2,
            KEY key3, Predicate predicate3,
            KEY key4, Predicate predicate4,
            KEY key5, Predicate predicate5,
            KEY key6) {
        return stream()
                .split(key1, predicate1,
                       key2, predicate2,
                       key3, predicate3,
                       key4, predicate4,
                       key5, predicate5,
                       key6);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy