jfun.jaskell.function
Class Function1

java.lang.Object
  extended by jfun.jaskell.function.Function1
All Implemented Interfaces:
java.io.Serializable, Function
Direct Known Subclasses:
Function2, Function3, Function4, Function5, FunctionN, StrictFunction1

public abstract class Function1
extends java.lang.Object
implements Function

Default implementation of Function. Subclass it to provide function with one parameter.

Zephyr Business Solutions Corp.

Author:
Ben Yu
See Also:
Serialized Form

Constructor Summary
Function1()
           
 
Method Summary
 java.lang.Object apply(java.lang.Object[] args)
          Call the function with an array of arguments.
 java.lang.Object apply(java.lang.Object[] args, int from, int len)
          Call the function with arguments stored in array args.
abstract  java.lang.Object call(java.lang.Object a)
          Override this method to provide function with one parameter.
 java.lang.Object f(java.lang.Object a)
          Call the function with one argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Function1

public Function1()
Method Detail

apply

public java.lang.Object apply(java.lang.Object[] args)
Description copied from interface: Function
Call the function with an array of arguments.

Specified by:
apply in interface Function
Parameters:
args - the arguments.
Returns:
the return value.

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
Parameters:
args - the array.
from - the starting index of the range.
len - the length of the range.
Returns:
the return value.

f

public java.lang.Object f(java.lang.Object a)
Description copied from interface: Function
Call the function with one argument.

Specified by:
f in interface Function
Parameters:
a - the argument.
Returns:
the return value.

call

public abstract java.lang.Object call(java.lang.Object a)
                               throws java.lang.Throwable
Override this method to provide function with one parameter.

Parameters:
a - the argument.
Returns:
the return value.
Throws:
java.lang.Throwable