public class Lambda
extends java.lang.Object
Constructor and Description |
---|
Lambda() |
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.Iterable<T> |
it(java.lang.Iterable<T> it) |
static <T1,R> Function1<T1,R> |
l1(Function1<T1,R> func)
e.g.
|
static <T1,T2,R> Function1<T1,Function1<T2,R>> |
l2(Function1<T1,Function1<T2,R>> biFunc)
Create a curried function with arity of 2
e.g.
|
static <T1,T2,T3,R> |
l3(Function1<T1,Function1<T2,Function1<T3,R>>> triFunc)
Create a curried function with arity of 3
e.g.
|
static <T1,T2,T3,T4,R> |
l4(Function1<T1,Function1<T2,Function1<T3,Function1<T4,R>>>> quadFunc)
Create a curried function with arity of 4
e.g.
|
static <T1,T2,T3,T4,T5,R> |
l5(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,R>>>>> pentFunc)
Create a curried function with arity of 5
e.g.
|
static <T1,T2,T3,T4,T5,T6,R> |
l6(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,R>>>>>> hexFunc)
Create a curried function with arity of 6
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,R> |
l7(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,R>>>>>>> heptFunc)
Create a curried function with arity of 7
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
l8(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,Function1<T8,R>>>>>>>> octFunc)
Create a curried function with arity of 8
e.g.
|
static <T> java.util.function.Predicate<T> |
p(java.util.function.Predicate<T> p) |
static <T> Function0<T> |
s(Function0<T> supplier)
E.g.
|
static <T1,T2,R> Function1<? super T1,? extends Function1<? super T2,? extends R>> |
v2(Function1<? super T1,Function1<? super T2,? extends R>> biFunc) |
static <T> Function0<T> |
λ(Function0<T> supplier)
E.g.
|
static <T1,R> Function1<T1,R> |
λ(Function1<T1,R> func)
Alias for l1
e.g.
|
static <T1,T2,R> Function2<T1,T2,R> |
λ(Function2<T1,T2,R> biFunc)
Create a curried function with arity of 2
e.g.
|
static <T1,T2,T3,R> |
λ(Function3<T1,T2,T3,R> triFunc)
Create a curried function with arity of 3
e.g.
|
static <T1,T2,T3,T4,R> |
λ(Function4<T1,T2,T3,T4,R> quadFunc)
Create a curried function with arity of 4
e.g.
|
static <T1,T2,T3,T4,T5,R> |
λ(Function5<T1,T2,T3,T4,T5,R> quintFunc)
Create a curried function with arity of 5
e.g.
|
static <T1,T2,T3,T4,T5,T6,R> |
λ(Function6<T1,T2,T3,T4,T5,T6,R> func6)
Create a curried function with arity of 6
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,R> |
λ(Function7<T1,T2,T3,T4,T5,T6,T7,R> func7)
Create a curried function with arity of 7
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
λ(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> func8)
Create a curried function with arity of 8
e.g.
|
static <T> java.util.function.Predicate<T> |
λ(java.util.function.Predicate<T> pred) |
public static <T> java.lang.Iterable<T> it(java.lang.Iterable<T> it)
public static <T> Function0<T> s(Function0<T> supplier)
return pos >= values.length ? tuple(true, split) : Lambda.s(() -> {
action.accept(values[pos++]);
return tuple(true, this);
}).getValue();
supplier
- Lambda / method to assign type of Supplier topublic static <T> Function0<T> λ(Function0<T> supplier)
return pos >= values.length ? tuple(true, split) : Lambda.s(() -> {
action.accept(values[pos++]);
return tuple(true, this);
}).getValue();
supplier
- Lambda / method to assign type of Supplier topublic static <T> java.util.function.Predicate<T> λ(java.util.function.Predicate<T> pred)
public static <T> java.util.function.Predicate<T> p(java.util.function.Predicate<T> p)
public static <T1,R> Function1<T1,R> λ(Function1<T1,R> func)
val fn = λ((Integer i)->"hello")
func
- public static <T1,R> Function1<T1,R> l1(Function1<T1,R> func)
val fn = l1((Integer i)->"hello")
func
- public static <T1,T2,R> Function2<T1,T2,R> λ(Function2<T1,T2,R> biFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
biFunc
- public static <T1,T2,T3,R> Function3<T1,T2,T3,R> λ(Function3<T1,T2,T3,R> triFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
triFunc
- public static <T1,T2,T3,T4,R> Function4<T1,T2,T3,T4,R> λ(Function4<T1,T2,T3,T4,R> quadFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quadFunc
- public static <T1,T2,T3,T4,T5,R> Function5<T1,T2,T3,T4,T5,R> λ(Function5<T1,T2,T3,T4,T5,R> quintFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quintFunc
- public static <T1,T2,T3,T4,T5,T6,R> Function6<T1,T2,T3,T4,T5,T6,R> λ(Function6<T1,T2,T3,T4,T5,T6,R> func6)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
func6
- public static <T1,T2,T3,T4,T5,T6,T7,R> Function7<T1,T2,T3,T4,T5,T6,T7,R> λ(Function7<T1,T2,T3,T4,T5,T6,T7,R> func7)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quadFunc
- public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> λ(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> func8)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quadFunc
- public static <T1,T2,R> Function1<T1,Function1<T2,R>> l2(Function1<T1,Function1<T2,R>> biFunc)
val fn = l3((Integer a)-> (Integer b)-> a+b+)
biFunc
- public static <T1,T2,R> Function1<? super T1,? extends Function1<? super T2,? extends R>> v2(Function1<? super T1,Function1<? super T2,? extends R>> biFunc)
public static <T1,T2,T3,R> Function1<T1,Function1<T2,Function1<T3,R>>> l3(Function1<T1,Function1<T2,Function1<T3,R>>> triFunc)
val fn = l3((Integer a)-> (Integer b)->(Integer c) -> a+b+c)
triFunc
- public static <T1,T2,T3,T4,R> Function1<T1,Function1<T2,Function1<T3,Function1<T4,R>>>> l4(Function1<T1,Function1<T2,Function1<T3,Function1<T4,R>>>> quadFunc)
val fn = l4((Integer a)-> (Integer b)->(Integer c) -> (Integer d) -> a+b+c+d)
quadFunc
- public static <T1,T2,T3,T4,T5,R> Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,R>>>>> l5(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,R>>>>> pentFunc)
val fn = l4((Integer a)-> (Integer b)->(Integer c) -> (Integer d) -> (Integer e) -> a+b+c+d+e)
pentFunc
- public static <T1,T2,T3,T4,T5,T6,R> Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,R>>>>>> l6(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,R>>>>>> hexFunc)
val fn = l4((Integer a)-> (Integer b)->(Integer c) -> (Integer d) -> (Integer e) -> (Integer f)-> a+b+c+d+e+f)
hexFunc
- public static <T1,T2,T3,T4,T5,T6,T7,R> Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,R>>>>>>> l7(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,R>>>>>>> heptFunc)
val fn = l4((Integer a)-> (Integer b)->(Integer c) -> (Integer d) -> (Integer e) -> (Integer f)->(Integer g) -> a+b+c+d+e+f+g)
heptFunc
- public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,Function1<T8,R>>>>>>>> l8(Function1<T1,Function1<T2,Function1<T3,Function1<T4,Function1<T5,Function1<T6,Function1<T7,Function1<T8,R>>>>>>>> octFunc)
val fn = l4((Integer a)-> (Integer b)->(Integer c) -> (Integer d) -> (Integer e) -> (Integer f)->(Integer g) -> (Integer h) ->a+b+c+d+e+f+g+h)
octFunc
-