public interface FunctionParser
MathsParse
implements some common functions used in phylogenetics
and is a useful example of how to implement this class.
The changes to this interface mean implementations of it for version 1.1 or less
will need updating although this should be a simple addition.Modifier and Type | Method and Description |
---|---|
double |
evaluate(java.lang.String function,
java.lang.Double[] variables)
A function that evaluates all the functions implemented
|
java.util.List<java.lang.String> |
implemented()
Returns a list of function names that this class can calculate
|
int |
numberInputs(java.lang.String function)
Returns the number of inputs a function expects to be passed
|
double evaluate(java.lang.String function, java.lang.Double[] variables) throws WrongNumberOfVariables, NoSuchFunction
function
- The function namevariables
- An array of inputs in the order they appear in the function
callWrongNumberOfVariables
- Thrown when the incorrect number of inputs
to that function is passed.NoSuchFunction
- Thrown when the class can't parse a function of
that nameint numberInputs(java.lang.String function) throws NoSuchFunction
function
- The function nameNoSuchFunction
- Thrown if the function parser does not implement a
function with that namejava.util.List<java.lang.String> implemented()