|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.functions.WrappedFunction<R>
public abstract class WrappedFunction<R>
A wrapped function is a base class for function objects based on an other function object.
| Field Summary | |
|---|---|
protected Function<R> |
wrappedFunction
|
| Constructor Summary | |
|---|---|
WrappedFunction(Function<R> function)
Constructor for Basic Function |
|
| Method Summary | |
|---|---|
Parameters |
createParameters()
Creates an empty 'Parameters' object for you, which you have to fill and feed back to getFunctionValue |
boolean |
equals(Object obj)
|
String |
getDescription()
|
R |
getFunctionValue(Parameters parameters)
Executes the defined function supplying the given arguments. |
R |
getFunctionValueWithArgs(Object... parameters)
A 'varargs' version of getFunctionValueWithList. |
R |
getFunctionValueWithList(List<?> parameters)
Executes the defined function supplying the given List of arguments. |
String |
getName()
A function must have a name. |
Parameter<?>[] |
getParameterDefinition()
|
ReturnType<R> |
getReturnType()
|
int |
hashCode()
|
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<R> type)
Sets the return type of the function's result value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Function<R> wrappedFunction
| Constructor Detail |
|---|
public WrappedFunction(Function<R> function)
function - The function to wrap| Method Detail |
|---|
public Parameters createParameters()
Function
createParameters in interface Function<R>Function.getFunctionValue(Parameters)public R getFunctionValue(Parameters parameters)
Function
getFunctionValue in interface Function<R>parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.
Implementors are encouraged to support null too.
Function.getReturnType()Function.createParameters()public R getFunctionValueWithList(List<?> parameters)
FunctionFunction.getFunctionValue(Parameters).
getFunctionValueWithList in interface Function<R>parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.
Function.getReturnType()public R getFunctionValueWithArgs(Object... parameters)
FunctiongetFunctionValueWithList.
getFunctionValueWithArgs in interface Function<R>public void setDescription(String description)
Function
setDescription in interface Function<R>public String getDescription()
getDescription in interface Function<R>Function.setDescription(String)public String getName()
Function
getName in interface Function<R>nullpublic Parameter<?>[] getParameterDefinition()
getParameterDefinition in interface Function<R>null if not set already.public void setParameterDefinition(Parameter<?>[] params)
Function
setParameterDefinition in interface Function<R>params - An array of Parameter objects.public ReturnType<R> getReturnType()
getReturnType in interface Function<R>null if unknown.public void setReturnType(ReturnType<R> type)
Function
setReturnType in interface Function<R>type - A ReturnType object. For void functions that could be ReturnType.VOID.public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||