|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A representation of a piece of functionality (a 'function'). A function has a name, a
return type, and a parameter-definition (which is a Parameter array).
The goal of a Function object is to call its getFunctionValue(Parameters) method, which
executes it, given the specified parameters.
Parameter,
Parameters| Method Summary | |
Parameters |
createParameters()
Creates an empty 'Parameters' object for you, which you have to fill and feed back to getFunctionValue |
String |
getDescription()
|
Object |
getFunctionValue(Parameters parameters)
Executes the defined function supplying the given arguments. |
Object |
getFunctionValueWithList(List parameters)
Executes the defined function supplying the given List of arguments. |
String |
getName()
A function must have a name. |
Parameter[] |
getParameterDefinition()
|
ReturnType |
getReturnType()
|
void |
setDescription(String description)
For documentational purposes a function object needs a description too. |
void |
setParameterDefinition(Parameter[] params)
A function object is of no use, as long as it lacks a definition. |
void |
setReturnType(ReturnType type)
Sets the return type of the function's result value. |
| Method Detail |
public Parameters createParameters()
getFunctionValue(Parameters)public Object getFunctionValue(Parameters parameters)
parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.
Implementors are encouraged to support null too.
getReturnType()createParameters()public Object getFunctionValueWithList(List parameters)
getFunctionValue(Parameters).
parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.
getReturnType()public void setDescription(String description)
public String getDescription()
setDescription(String)public String getName()
nullpublic Parameter[] getParameterDefinition()
null if not set already.public void setParameterDefinition(Parameter[] params)
params - An array of Parameter objects.
IllegalStateException - if there was already set a parameter definition for this function object.public ReturnType getReturnType()
null if unknown.public void setReturnType(ReturnType type)
type - A ReturnType object. For void functions that could be ReturnType.VOID.
IllegalStateException - if there was already set a return type for this function object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||