|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.javelot.functionalj.Function
info.javelot.functionalj.FunctionN
Represents a function of N parameters, which is constructed by
specifying an implementation of the IFunctionN interface. This is useful
to specify a function directly rather than using reflection. If, on the other
hand, you want to create a function without having to implement an interface, use
a subclass of ReflectionFunction instead.
| Field Summary |
| Fields inherited from class info.javelot.functionalj.Function |
m_class, m_name, m_object, m_parameters, m_targets |
| Constructor Summary | |
FunctionN(IFunctionN p_iFunctionN)
Creates a function of N parameters which uses the specified
implementation of the function interface. |
|
FunctionN(IFunctionN p_iFunctionN,
Object[] p_parameters)
Creates a function of N parameters which uses the specified
implementation of the function interface and the given parameters. |
|
| Method Summary | |
Object |
call()
Calls the function by invoking the target using the parameters that have been previously supplied (if any) and returns the result. |
boolean |
isObjectRequired()
Returns false since an object is not required to invoke the
method. |
protected Function |
newInstance(Class p_class,
Object[] p_parameters)
Creates a new FunctionN object using the specified parameters. |
Function |
object(Object p_object)
Throws a FunctionException, since no object is required to invoke a
method that is wrapped using an interface. |
| Methods inherited from class info.javelot.functionalj.Function |
addParameter, addParameters, addParameters, addParameters, addParameters, addParameters, getName, getObject, getParameters, getTargetClass, getTargets, isObjectPresent, objectOrParameter, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FunctionN(IFunctionN p_iFunctionN)
N parameters which uses the specified
implementation of the function interface. After using this constructor the
function does not yet have any parameters.
p_iFunctionN - the implementation of IFunctionN which defines the
function.
public FunctionN(IFunctionN p_iFunctionN,
Object[] p_parameters)
N parameters which uses the specified
implementation of the function interface and the given parameters.
p_iFunctionN - the implementation of IFunctionN which defines the
function.p_parameters - the parameters to the function.| Method Detail |
public boolean isObjectRequired()
false since an object is not required to invoke the
method.
isObjectRequired in class Functionfalse.
protected Function newInstance(Class p_class,
Object[] p_parameters)
FunctionN object using the specified parameters. In
this case the target class is not used.
newInstance in class Functionp_class - the class of the target.p_parameters - the supplied parameters.
FunctionN object using the supplied parameters.
public Function object(Object p_object)
throws FunctionException
FunctionException, since no object is required to invoke a
method that is wrapped using an interface.
object in class FunctionFunctionException - always thrown since invoking this method is not
applicable to instances of the FunctionN class.
public Object call()
throws FunctionException
FunctionException.
call in class FunctionFunctionException - thrown if an exception occurs when invoking the
target.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||