public abstract class CustomFunction extends Object
CustomFunction fooFunc = new CustomFunction("foo") {
public double applyFunction(double value) {
return value*Math.E;
}
};
double varX=12d;
Calculable calc = new ExpressionBuilder("foo(x)").withCustomFunction(fooFunc).withVariable("x",varX).build();
assertTrue(calc.calculate() == Math.E * varX);
}
| Modifier | Constructor and Description |
|---|---|
protected |
CustomFunction(String name)
create a new single value input CustomFunction with a set name
|
protected |
CustomFunction(String name,
int argumentCount)
create a new single value input CustomFunction with a set name
|
protected CustomFunction(String name) throws InvalidCustomFunctionException
value - the name of the function (e.g. foo)InvalidCustomFunctionExceptionprotected CustomFunction(String name, int argumentCount) throws InvalidCustomFunctionException
value - the name of the function (e.g. foo)InvalidCustomFunctionExceptionCopyright © 2013. All Rights Reserved.