jfun.jaskell
Class StrictFunction1

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

public abstract class StrictFunction1
extends Function1

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
StrictFunction1(java.lang.String name)
          Create a StrictFunction1 object.
 
Method Summary
 java.lang.Object call(java.lang.Object o)
          Override this method to provide function with one parameter.
abstract  java.lang.Object fn(java.lang.Object obj)
          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.Function1
apply, apply, f
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StrictFunction1

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

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

fn

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

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

call

public final java.lang.Object call(java.lang.Object o)
                            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:
o - the 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.