public class MathsParse
extends java.lang.Object
FunctionParser
to the constructor.Constructor and Description |
---|
MathsParse(FunctionParser... fps)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
parseEquation(java.lang.String equation,
java.util.Map<java.lang.String,java.lang.Double> values)
Parses an equation and returns the result
|
public MathsParse(FunctionParser... fps)
fps
- A variable number of parsers that define additional functions.
If none is passed then only the default functions are avaliable.public double parseEquation(java.lang.String equation, java.util.Map<java.lang.String,java.lang.Double> values) throws NoSuchFunction, WrongNumberOfVariables
equation
- The equation to parsevalues
- Map from a string to a double that represents the value of
any variables in the equationNoSuchFunction
- If the equation uses an undefined functionWrongNumberOfVariables
- If the equation uses a function and passes
it the wrong number of variables