info.javelot.functionalj
Class Function1Impl<R,P>

java.lang.Object
  extended by info.javelot.functionalj.Function1Impl<R,P>
All Implemented Interfaces:
Function1<R,P>

public abstract class Function1Impl<R,P>
extends Object
implements Function1<R,P>

A base implementation of the Function1 interface, which implements all methods except for the Function1.call(Object) method - that is left to subclasses to implement in order to define a function of 1 parameter.

Author:
Copyright © 2006 Frederic Daoud

Constructor Summary
Function1Impl()
           
 
Method Summary
 Function0<R> bind(P p_param)
          Binds the parameter of this function of 1 parameter to return a new function of no parameters.
 Function0<R> compose(Function0<P> p_function0)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
<P1> Function1<R,P1>
compose(Function1<P,P1> p_function1)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
<P1,P2> Function2<R,P1,P2>
compose(Function2<P,P1,P2> p_function2)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
<P1,P2,P3> Function3<R,P1,P2,P3>
compose(Function3<P,P1,P2,P3> p_function3)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
<P1,P2,P3,P4>
Function4<R,P1,P2,P3,P4>
compose(Function4<P,P1,P2,P3,P4> p_function4)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
 FunctionN<R> compose(FunctionN<P> p_functionN)
          Composes this function with the given function to return a new function according to function composition as described in the interface Function1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.javelot.functionalj.Function1
call
 

Constructor Detail

Function1Impl

public Function1Impl()
Method Detail

bind

public Function0<R> bind(P p_param)
Description copied from interface: Function1
Binds the parameter of this function of 1 parameter to return a new function of no parameters.

Specified by:
bind in interface Function1<R,P>
Parameters:
p_param - the parameter to bind to the function.
Returns:
a new function of no parameters.

compose

public Function0<R> compose(Function0<P> p_function0)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_function0 - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.

compose

public <P1> Function1<R,P1> compose(Function1<P,P1> p_function1)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_function1 - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.

compose

public <P1,P2> Function2<R,P1,P2> compose(Function2<P,P1,P2> p_function2)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_function2 - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.

compose

public <P1,P2,P3> Function3<R,P1,P2,P3> compose(Function3<P,P1,P2,P3> p_function3)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_function3 - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.

compose

public <P1,P2,P3,P4> Function4<R,P1,P2,P3,P4> compose(Function4<P,P1,P2,P3,P4> p_function4)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_function4 - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.

compose

public FunctionN<R> compose(FunctionN<P> p_functionN)
Description copied from interface: Function1
Composes this function with the given function to return a new function according to function composition as described in the interface Function1.

Specified by:
compose in interface Function1<R,P>
Parameters:
p_functionN - the function g to compose with this function f.
Returns:
a new function h such that h(x) = f(g(x)), where x represents all parameters accepted by g.