jfun.yan.function
Interface Function<T>

All Superinterfaces:
java.io.Serializable, Signature<T>

public interface Function<T>
extends java.io.Serializable, Signature<T>

Function abstracts the concept of any invokable entity. that has typed parameters and return values. java.lang.reflect.Method and java.lang.reflect.Constructor are the two entities made implementation of this interface.

Codehaus.org.

Author:
Ben Yu

Method Summary
 T call(java.lang.Object[] args)
          Invoke this function.
 java.lang.String getName()
          Get the name of the signature.
 java.lang.Class[] getParameterTypes()
          Gets the parameter types of the function.
 java.lang.Class<T> getReturnType()
          Gets the return type of the function.
 boolean isConcrete()
          To determine if the type returned by getReturnType() is the concrete type of the real return value.
 

Method Detail

isConcrete

boolean isConcrete()
To determine if the type returned by getReturnType() is the concrete type of the real return value.

Static type check will be performed on concrete types.


getReturnType

java.lang.Class<T> getReturnType()
Gets the return type of the function.

Specified by:
getReturnType in interface Signature<T>
Returns:
the return type.

getParameterTypes

java.lang.Class[] getParameterTypes()
Gets the parameter types of the function.

Specified by:
getParameterTypes in interface Signature<T>
Returns:
the parameter types.

call

T call(java.lang.Object[] args)
       throws java.lang.Throwable
Invoke this function.

Parameters:
args - the arguments.
Returns:
the return value.
Throws:
java.lang.Throwable

getName

java.lang.String getName()
Get the name of the signature.

Specified by:
getName in interface Signature<T>