jfun.jaskell.function
Class FunctionN

java.lang.Object
  extended by jfun.jaskell.function.Function1
      extended by jfun.jaskell.function.FunctionN
All Implemented Interfaces:
java.io.Serializable, Function

public final class FunctionN
extends Function1

Provide function implementation with n parameters. This class implements currying.

Zephyr Business Solutions Corp.

Author:
Ben Yu
See Also:
Serialized Form

Method Summary
 java.lang.Object apply(java.lang.Object[] args, int from, int len)
          Call the function with arguments stored in array args.
 java.lang.Object call(java.lang.Object obj)
          Override this method to provide function with one parameter.
 boolean equals(java.lang.Object o)
           
static Function getFunction(int total, LamdaN lamdan)
          adapt a LamdaN object to a Function object by providing currying (partial application).
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class jfun.jaskell.function.Function1
apply, f
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getFunction

public static Function getFunction(int total,
                                   LamdaN lamdan)
adapt a LamdaN object to a Function object by providing currying (partial application).

Parameters:
total - the total number of parameters expected.
lamdan - the LamdaN object.
Returns:
the Function object.

call

public java.lang.Object call(java.lang.Object obj)
                      throws java.lang.Throwable
Description copied from class: Function1
Override this method to provide function with one parameter.

Specified by:
call in class Function1
Parameters:
obj - the argument.
Returns:
the return value.
Throws:
java.lang.Throwable

apply

public java.lang.Object apply(java.lang.Object[] args,
                              int from,
                              int len)
Description copied from interface: Function
Call the function with arguments stored in array args. Only objects in the range [from, from+len) are used.

Specified by:
apply in interface Function
Overrides:
apply in class Function1
Parameters:
args - the array.
from - the starting index of the range.
len - the length of the range.
Returns:
the return value.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object