|
|||||||||
| PREV CLASS NEXT CLASS | All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhplot.math.exp4j.ExpressionBuilder
public class ExpressionBuilder
This is Builder implementation for the exp4j API used to create a Calculable instance for the user
| Constructor Summary | |
|---|---|
ExpressionBuilder(String expression)
Create a new ExpressionBuilder |
|
| Method Summary | |
|---|---|
Calculable |
build()
build a new Calculable from the expression using the supplied
variables |
ExpressionBuilder |
withCustomFunction(CustomFunction function)
add a custom function instance for the evaluator to recognize |
ExpressionBuilder |
withCustomFunctions(Collection<CustomFunction> functions)
|
ExpressionBuilder |
withVariable(String variableName,
double value)
set the value for a variable |
ExpressionBuilder |
withVariableNames(String... variableNames)
set the variables names used in the expression without setting their values |
ExpressionBuilder |
withVariables(Map<String,Double> variableMap)
set the values for variables |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpressionBuilder(String expression)
expression - the expression to evaluate| Method Detail |
|---|
public Calculable build()
throws UnknownFunctionException,
UnparsableExpressionException
Calculable from the expression using the supplied
variables
Calculable which can be used to evaluate the
expression
UnknownFunctionException - when an unrecognized function name is used in the expression
UnparsableExpressionException - if the expression could not be parsedpublic ExpressionBuilder withCustomFunction(CustomFunction function)
function - the CustomFunction to add
ExpressionBuilder instancepublic ExpressionBuilder withCustomFunctions(Collection<CustomFunction> functions)
public ExpressionBuilder withVariable(String variableName,
double value)
variableName - the variable name e.g. "x"value - the value e.g. 2.32d
ExpressionBuilder instancepublic ExpressionBuilder withVariableNames(String... variableNames)
variableNames - vararg String of the variable names used in the
expression
public ExpressionBuilder withVariables(Map<String,Double> variableMap)
variableMap - a map of variable names to variable values
ExpressionBuilder instance
|
|||||||||
| PREV CLASS NEXT CLASS | All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||