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> Fn1<T1,R> |
l1(Fn1<T1,R> func)
e.g.
|
static <T1,T2,R> Fn1<T1,Fn1<T2,R>> |
l2(Fn1<T1,Fn1<T2,R>> biFunc)
Create a curried function with arity of 2
e.g.
|
static <T1,T2,T3,R> |
l3(Fn1<T1,Fn1<T2,Fn1<T3,R>>> triFunc)
Create a curried function with arity of 3
e.g.
|
static <T1,T2,T3,T4,R> |
l4(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,R>>>> quadFunc)
Create a curried function with arity of 4
e.g.
|
static <T1,T2,T3,T4,T5,R> |
l5(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,R>>>>> pentFunc)
Create a curried function with arity of 5
e.g.
|
static <T1,T2,T3,T4,T5,T6,R> |
l6(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,R>>>>>> hexFunc)
Create a curried function with arity of 6
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,R> |
l7(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<T7,R>>>>>>> heptFunc)
Create a curried function with arity of 7
e.g.
|
static <T1,T2,T3,T4,T5,T6,T7,T8,R> |
l8(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<T7,Fn1<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> Fn0<T> |
s(Fn0<T> supplier)
E.g.
|
static <T1,T2,R> Fn1<? super T1,? extends Fn1<? super T2,? extends R>> |
v2(Fn1<? super T1,Fn1<? super T2,? extends R>> biFunc) |
static <T> Fn0<T> |
λ(Fn0<T> supplier)
E.g.
|
static <T1,R> Fn1<T1,R> |
λ(Fn1<T1,R> func)
Alias for l1
e.g.
|
static <T1,T2,R> Fn2<T1,T2,R> |
λ(Fn2<T1,T2,R> biFunc)
Create a curried function with arity of 2
e.g.
|
static <T1,T2,T3,R> |
λ(Fn3<T1,T2,T3,R> triFunc)
Create a curried function with arity of 3
e.g.
|
static <T1,T2,T3,T4,R> |
λ(Fn4<T1,T2,T3,T4,R> quadFunc)
Create a curried function with arity of 4
e.g.
|
static <T1,T2,T3,T4,T5,R> |
λ(Fn5<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> |
λ(Fn6<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> |
λ(Fn7<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> |
λ(Fn8<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) |
static <T> Fn0.SupplierKind<T> |
λK(Fn0.SupplierKind<T> supplier) |
public static <T> java.lang.Iterable<T> it(java.lang.Iterable<T> it)
public static <T> Fn0<T> s(Fn0<T> supplier)
return pos >= values.length ? tuple(true, split) : Lambda.s(() -> {
action.accept(values[pos++]);
return tuple(true, this);
}).get();
supplier - Lambda / method to assign type of Supplier topublic static <T> Fn0<T> λ(Fn0<T> supplier)
return pos >= values.length ? tuple(true, split) : Lambda.s(() -> {
action.accept(values[pos++]);
return tuple(true, this);
}).get();
supplier - Lambda / method to assign type of Supplier topublic static <T> Fn0.SupplierKind<T> λK(Fn0.SupplierKind<T> supplier)
public 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> Fn1<T1,R> λ(Fn1<T1,R> func)
val fn = λ((Integer i)->"hello")
func - public static <T1,R> Fn1<T1,R> l1(Fn1<T1,R> func)
val fn = l1((Integer i)->"hello")
func - public static <T1,T2,R> Fn2<T1,T2,R> λ(Fn2<T1,T2,R> biFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
biFunc - public static <T1,T2,T3,R> Fn3<T1,T2,T3,R> λ(Fn3<T1,T2,T3,R> triFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
triFunc - public static <T1,T2,T3,T4,R> Fn4<T1,T2,T3,T4,R> λ(Fn4<T1,T2,T3,T4,R> quadFunc)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quadFunc - public static <T1,T2,T3,T4,T5,R> Fn5<T1,T2,T3,T4,T5,R> λ(Fn5<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> Fn6<T1,T2,T3,T4,T5,T6,R> λ(Fn6<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> Fn7<T1,T2,T3,T4,T5,T6,T7,R> λ(Fn7<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> Fn8<T1,T2,T3,T4,T5,T6,T7,T8,R> λ(Fn8<T1,T2,T3,T4,T5,T6,T7,T8,R> func8)
val fn = λ((Integer a)-> (Integer b)-> a+b+)
quadFunc - public static <T1,T2,R> Fn1<T1,Fn1<T2,R>> l2(Fn1<T1,Fn1<T2,R>> biFunc)
val fn = l3((Integer a)-> (Integer b)-> a+b+)
biFunc - public static <T1,T2,R> Fn1<? super T1,? extends Fn1<? super T2,? extends R>> v2(Fn1<? super T1,Fn1<? super T2,? extends R>> biFunc)
public static <T1,T2,T3,R> Fn1<T1,Fn1<T2,Fn1<T3,R>>> l3(Fn1<T1,Fn1<T2,Fn1<T3,R>>> triFunc)
val fn = l3((Integer a)-> (Integer b)->(Integer c) -> a+b+c)
triFunc - public static <T1,T2,T3,T4,R> Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,R>>>> l4(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<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> Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,R>>>>> l5(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<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> Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,R>>>>>> l6(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<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> Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<T7,R>>>>>>> l7(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<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> Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<T7,Fn1<T8,R>>>>>>>> l8(Fn1<T1,Fn1<T2,Fn1<T3,Fn1<T4,Fn1<T5,Fn1<T6,Fn1<T7,Fn1<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 -