org.javimmutable.collections.util
Class Curry

java.lang.Object
  extended by org.javimmutable.collections.util.Curry

public final class Curry
extends Object

Contains static factory methods to produce Curried versions of functions.


Method Summary
static
<P1,P2,R> Func1<P2,R>
func1(P1 param1, Func2<P1,P2,R> function)
          Produces a Curried Func1 that calls the provided Func2 passing it the fixed parameter param1 along with the actual parameters to the apply() method.
static
<P1,P2,P3,R>
Func1<P3,R>
func1(P1 param1, P2 param2, Func3<P1,P2,P3,R> function)
          Produces a Curried Func1 that calls the provided Func3 passing it the fixed parameters param1 and param2 along with the actual parameters to the apply() method.
static
<P1,P2,P3,P4,R>
Func1<P4,R>
func1(P1 param1, P2 param2, P3 param3, Func4<P1,P2,P3,P4,R> function)
          Produces a Curried Func1 that calls the provided Func4 passing it the fixed parameters param1 and param2 along with the actual parameters to the apply() method.
static
<P1,P2,P3,R>
Func2<P2,P3,R>
func2(P1 param1, Func3<P1,P2,P3,R> function)
          Produces a Curried Func2 that calls the provided Func3 passing it the fixed parameter param1 along with the actual parameters to the apply() method.
static
<P1,P2,P3,P4,R>
Func2<P3,P4,R>
func2(P1 param1, P2 param2, Func4<P1,P2,P3,P4,R> function)
          Produces a Curried Func3 that calls the provided Func4 passing it the fixed parameter param1 along with the actual parameters to the apply() method.
static
<P1,P2,P3,P4,R>
Func3<P2,P3,P4,R>
func3(P1 param1, Func4<P1,P2,P3,P4,R> function)
          Produces a Curried Func3 that calls the provided Func4 passing it the fixed parameter param1 along with the actual parameters to the apply() method.
static
<P1,P2,R> Func1<P2,R>
of(Func2<P1,P2,R> function, P1 param1)
          Produces a Curried Func1 that calls the provided Func2 passing it the fixed parameter param1 along with the actual parameter to the apply() method as the second parameter.
static
<P1,P2,P3,R>
Func1<P3,R>
of(Func3<P1,P2,P3,R> function, P1 param1, P2 param2)
          Produces a Curried Func1 that calls the provided Func3 passing it the fixed parameters param1-param2 along with the actual parameter to the apply() method as the third parameter.
static
<P1,P2,P3,P4,R>
Func1<P4,R>
of(Func4<P1,P2,P3,P4,R> function, P1 param1, P2 param2, P3 param3)
          Produces a Curried Func1 that calls the provided Func4 passing it the fixed parameters param1-param3 along with the actual parameter to the apply() method as the fourth parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

of

public static <P1,P2,P3,P4,R> Func1<P4,R> of(Func4<P1,P2,P3,P4,R> function,
                                             P1 param1,
                                             P2 param2,
                                             P3 param3)
Produces a Curried Func1 that calls the provided Func4 passing it the fixed parameters param1-param3 along with the actual parameter to the apply() method as the fourth parameter.

Type Parameters:
P1 -
P2 -
P3 -
P4 -
R -
Parameters:
function -
param1 -
param2 -
param3 -
Returns:

of

public static <P1,P2,P3,R> Func1<P3,R> of(Func3<P1,P2,P3,R> function,
                                          P1 param1,
                                          P2 param2)
Produces a Curried Func1 that calls the provided Func3 passing it the fixed parameters param1-param2 along with the actual parameter to the apply() method as the third parameter.

Type Parameters:
P1 -
P2 -
P3 -
R -
Parameters:
function -
param1 -
param2 -
Returns:

of

public static <P1,P2,R> Func1<P2,R> of(Func2<P1,P2,R> function,
                                       P1 param1)
Produces a Curried Func1 that calls the provided Func2 passing it the fixed parameter param1 along with the actual parameter to the apply() method as the second parameter.

Type Parameters:
P1 -
P2 -
R -
Parameters:
function -
param1 -
Returns:

func3

public static <P1,P2,P3,P4,R> Func3<P2,P3,P4,R> func3(P1 param1,
                                                      Func4<P1,P2,P3,P4,R> function)
Produces a Curried Func3 that calls the provided Func4 passing it the fixed parameter param1 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:

func2

public static <P1,P2,P3,R> Func2<P2,P3,R> func2(P1 param1,
                                                Func3<P1,P2,P3,R> function)
Produces a Curried Func2 that calls the provided Func3 passing it the fixed parameter param1 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:

func2

public static <P1,P2,P3,P4,R> Func2<P3,P4,R> func2(P1 param1,
                                                   P2 param2,
                                                   Func4<P1,P2,P3,P4,R> function)
Produces a Curried Func3 that calls the provided Func4 passing it the fixed parameter param1 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:

func1

public static <P1,P2,R> Func1<P2,R> func1(P1 param1,
                                          Func2<P1,P2,R> function)
Produces a Curried Func1 that calls the provided Func2 passing it the fixed parameter param1 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:

func1

public static <P1,P2,P3,R> Func1<P3,R> func1(P1 param1,
                                             P2 param2,
                                             Func3<P1,P2,P3,R> function)
Produces a Curried Func1 that calls the provided Func3 passing it the fixed parameters param1 and param2 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:

func1

public static <P1,P2,P3,P4,R> Func1<P4,R> func1(P1 param1,
                                                P2 param2,
                                                P3 param3,
                                                Func4<P1,P2,P3,P4,R> function)
Produces a Curried Func1 that calls the provided Func4 passing it the fixed parameters param1 and param2 along with the actual parameters to the apply() method.

Parameters:
param1 -
function -
Returns:


Copyright © 2014 Burton Computer Corporation. All rights reserved.