|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.formula.FunctionFactory
FunctionFactory allows convenient instantiation of objects that implement the Function interface.
| Constructor Summary | |
protected |
FunctionFactory()
Protected constructor hides the inherited public constructor. |
| Method Summary | |
static Function |
function(java.lang.Class targetClass,
java.lang.String name)
Convenience method for creating a single argument function that wraps a method from the specified target class. |
static Function |
function(java.lang.Class targetClass,
java.lang.String name,
int numArgs)
Convenience method for creating a multi-argument function that wraps a method from the specified target class. |
static Function |
mathFunction(java.lang.String name)
Instantiate a single argument function that wraps a method of the given name from the Math class. |
static Function |
mathFunction(java.lang.String name,
int numArgs)
Instantiate a function that wraps a method of the given name from the Math class given the specified number of arguments of type double. |
static Function |
maxFunction()
Create a max function of multiple arguments. |
static Function |
minFunction()
Create a min function of multiple arguments. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected FunctionFactory()
| Method Detail |
public static Function mathFunction(java.lang.String name)
throws java.lang.NoSuchMethodException
name - name of the method and the resulting function
java.lang.NoSuchMethodException - if there is no Math method of the given name which takes a single argument of type double
public static Function mathFunction(java.lang.String name,
int numArgs)
throws java.lang.NoSuchMethodException
double.
name - name of the method and the resulting functionnumArgs - number of method arguments of type double
java.lang.NoSuchMethodException - if there is no Math method of the given name which takes numArgs arguments of type double
public static Function function(java.lang.Class targetClass,
java.lang.String name)
throws java.lang.NoSuchMethodException
double.
targetClass - class from which to get the methodname - name of the method and the resulting function
java.lang.NoSuchMethodException - if there is no method of the given name which takes a single argument of type double within targetClass
public static Function function(java.lang.Class targetClass,
java.lang.String name,
int numArgs)
throws java.lang.NoSuchMethodException
double.
targetClass - class from which to get the methodname - name of the method and the resulting functionnumArgs - number of method arguments of type double
java.lang.NoSuchMethodException - if there is no method of the given name which takes numArgs arguments of type double within targetClasspublic static Function minFunction()
public static Function maxFunction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||