public final class PostfixExpression extends Object implements Calculable
PostfixExpression is by
using the static factory method fromInfix()| Modifier and Type | Method and Description |
|---|---|
double |
calculate(double... values)
calculate the result of the expression and substitute the variables by
their values beforehand
|
double |
eval()
delegate the calculation of a simple expression without variables
|
double[] |
eval(String variableName,
double[] a)
Calculate values for array
|
P1D |
eval(String variableName,
double min,
double max,
int points)
Calcalate P1D in the range.
|
P1D |
eval(String variableName,
P0D a)
Calculate values for array
|
static PostfixExpression |
fromInfix(String expression)
Deprecated.
please use
ExpressionBuilder API |
static PostfixExpression |
fromInfix(String expression,
Set<CustomFunction> customFunctions)
Deprecated.
please use
ExpressionBuilder |
String |
getExpression()
get the mathematical expression
String |
NumberFormat |
getNumberFormat()
get the used
NumberFormat |
void |
setVariable(String name,
double value)
set a variable value for the calculation
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetExpression@Deprecated public static PostfixExpression fromInfix(String expression) throws UnparsableExpressionException, UnknownFunctionException
ExpressionBuilder APIPostfixExpressions from human
readable infix expressionsexpression - the infix expression to be usedPostfixExpressionUnparsableExpressionException - if the expression was invalidUnknownFunctionException - if an unknown function has been used@Deprecated public static PostfixExpression fromInfix(String expression, Set<CustomFunction> customFunctions) throws UnparsableExpressionException, UnknownFunctionException
ExpressionBuilderPostfixExpressions from human
readable infix expressionsexpression - the infix expression to be usedcustomFunctions - the CustomFunction implementations usedPostfixExpressionUnparsableExpressionException - if the expression was invalidUnknownFunctionException - if an unknown function has been usedpublic double eval()
eval in interface Calculablepublic double calculate(double... values)
throws IllegalArgumentException
values - the variable values to be substitutedIllegalArgumentException - if the variables are invalidpublic void setVariable(String name, double value)
CalculablesetVariable in interface Calculablename - the variable namevalue - the value of the variablepublic double[] eval(String variableName, double[] a)
a - array with X valuespublic P1D eval(String variableName, P0D a)
a - array with X valuespublic P1D eval(String variableName, double min, double max, int points)
variableName - min - min value in Xmax - max value in Ypoints - number of points for evaluationpublic String getExpression()
Stringpublic NumberFormat getNumberFormat()
NumberFormatNumberFormatjHepWork 3.5 ©