|
|||||||||
| PREV CLASS NEXT CLASS | All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhplot.math.exp4j.PostfixExpression
public final class PostfixExpression
Class for calculating values from a RPN postfix expression.
The default way to create a new instance of PostfixExpression is by
using the static factory method fromInfix()
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jhplot.math.exp4j.Calculable |
|---|
getExpression |
| Method Detail |
|---|
@Deprecated
public static PostfixExpression fromInfix(String expression)
throws UnparsableExpressionException,
UnknownFunctionException
ExpressionBuilder API
PostfixExpressions from human
readable infix expressions
expression - the infix expression to be used
PostfixExpression
UnparsableExpressionException - if the expression was invalid
UnknownFunctionException - if an unknown function has been used
@Deprecated
public static PostfixExpression fromInfix(String expression,
Set<CustomFunction> customFunctions)
throws UnparsableExpressionException,
UnknownFunctionException
ExpressionBuilder
PostfixExpressions from human
readable infix expressions
expression - the infix expression to be usedcustomFunctions - the CustomFunction implementations used
PostfixExpression
UnparsableExpressionException - if the expression was invalid
UnknownFunctionException - if an unknown function has been usedpublic double eval()
eval in interface Calculable
public double calculate(double... values)
throws IllegalArgumentException
values - the variable values to be substituted
IllegalArgumentException - if the variables are invalid
public void setVariable(String name,
double value)
Calculable
setVariable in interface Calculablename - the variable namevalue - the value of the variable
public double[] eval(String variableName,
double[] a)
a - array with X values
public P1D eval(String variableName,
P0D a)
a - array with X values
public P1D eval(String variableName,
double min,
double max,
int points)
variableName - min - min value in Xmax - max value in Ypoints - number of points for evaluation
public String getExpression()
String
public NumberFormat getNumberFormat()
NumberFormat
NumberFormat
|
|||||||||
| PREV CLASS NEXT CLASS | All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||