jfun.jaskell
Class StrictFunction2

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

public abstract class StrictFunction2
extends Function2

extend this class to provide a strict function implementation. Subclassing this class is more efficient than calling addStrictFunction.
A strict function is a function whose arguments are evaluated before the function body is evaluated.

Zephyr Business Solutions Corp.

Author:
Ben Yu
See Also:
Serialized Form

Constructor Summary
StrictFunction2(java.lang.String name)
          Create a StrictFunction2 object.
 
Method Summary
 java.lang.Object call(java.lang.Object a, java.lang.Object b)
          Override this method to provide function with two parameters.
abstract  java.lang.Object fn(java.lang.Object a, java.lang.Object b)
          Subclass override this method to provide the function implementation.
 java.lang.String getName()
          get the string representation of this function.
 java.lang.String toString()
          Returns the string representation.
 
Methods inherited from class jfun.jaskell.function.Function2
call
 
Methods inherited from class jfun.jaskell.function.Function1
apply, apply, f
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StrictFunction2

public StrictFunction2(java.lang.String name)
Create a StrictFunction2 object.

Parameters:
name - the string representation of this function.
Method Detail

fn

public abstract java.lang.Object fn(java.lang.Object a,
                                    java.lang.Object b)
                             throws java.lang.Throwable
Subclass override this method to provide the function implementation.

Parameters:
a - 1st argument.
b - 2nd argument.
Returns:
return value.
Throws:
java.lang.Throwable

call

public final java.lang.Object call(java.lang.Object a,
                                   java.lang.Object b)
                            throws java.lang.Throwable
Description copied from class: Function2
Override this method to provide function with two parameters.

Specified by:
call in class Function2
Parameters:
a - 1st argument.
b - 2nd argument.
Returns:
the return value.
Throws:
java.lang.Throwable

toString

public java.lang.String toString()
Returns the string representation.

Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
get the string representation of this function. The same string is returned by the toString() method.

Returns:
the string representation of this function.