|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FunctionParser
Interface for a function parser. That is a class that parses a string of
the form "function[double1,double2,...]" and return a numerical function
of it. MathsParse
implements some common functions used in phylogenetics
and is a useful example of how to implement this class.
The chnages to this injterface mean implementations of it for version 1.1 or less
will need updating although this should be a simple addition.
Method Summary | |
---|---|
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 |
Method Detail |
---|
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
call
WrongNumberOfVariables
- Thrown when the incorrect number of imputs
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 name
NoSuchFunction
- Thrown if the fucntion parser does not implement a
function with that namejava.util.List<java.lang.String> implemented()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |