public class ExpCalculator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ExpCalculator.Opt
Expression operator type
|
static class |
ExpCalculator.Rec
The expression string is convert to a list of Rec.
|
Modifier and Type | Field and Description |
---|---|
static char |
chAdd |
static char |
chDiv |
static char |
chMul |
static char |
chSub |
Constructor and Description |
---|
ExpCalculator(java.lang.String exp)
Contructor for an expression calculator object
|
Modifier and Type | Method and Description |
---|---|
double |
eval(double[] xAry)
Evaluate the expression based on the input value arary.
|
ExpCalculator.Rec[] |
getRecList()
Get the expression component record list
|
boolean |
hasField(java.lang.String fieldName)
check if the expression has the field identified by the name
|
boolean |
hasVarType(CMLVarEnum type)
check if the expression has the var type
|
static boolean |
isExpression(java.lang.String exp)
Check if the string is an InterPSS expression
|
java.lang.String |
toString()
convert the object states to a string
|
public static final char chAdd
public static final char chSub
public static final char chMul
public static final char chDiv
public ExpCalculator(java.lang.String exp) throws InterpssException
exp
- the expression stringjava.lang.Exception
- exception if the format is wrongInterpssException
public static boolean isExpression(java.lang.String exp)
exp
- public ExpCalculator.Rec[] getRecList()
public double eval(double[] xAry) throws InterpssException
xAry
- the vaule arrayjava.lang.Exception
- when the value array has worng diamensionInterpssException
public boolean hasVarType(CMLVarEnum type)
public boolean hasField(java.lang.String fieldName)
fieldName
- public java.lang.String toString()
toString
in class java.lang.Object