|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nfunk.jep.JEP
@Deprecated public class JEP
This class serves as a compatibility class to assist in the transition from Jep 2.x to Jep 3.0. The class is deprecated and should only be used if using com.singularsys.jep.JEP is not feasible.
Only the core functionality of the 2.x Jep class is maintained in this class. Some functionality has been omitted.
Visit http://www.singularsys.com/jep for the newest version of Jep, and complete documentation.
Field Summary | |
---|---|
protected java.util.ArrayList<java.lang.String> |
errorList
Deprecated. Error List |
protected boolean |
traverse
Deprecated. Traverse the tree after parsing |
Constructor Summary | |
---|---|
JEP()
Deprecated. Creates a new JEP instance with the default settings. |
|
JEP(boolean traverse_in,
boolean allowUndeclared_in,
boolean implicitMul_in,
NumberFactory numberFactory_in)
Deprecated. Creates a new JEP instance with custom settings. |
Method Summary | |
---|---|
void |
addComplex()
Deprecated. Call this function if you want to parse expressions which involve complex numbers. |
void |
addFunction(java.lang.String functionName,
PostfixMathCommandI function)
Deprecated. Adds a new function to the parser. |
void |
addStandardConstants()
Deprecated. Adds the constants pi and e to the parser. |
void |
addStandardFunctions()
Deprecated. Adds the standard functions to the parser. |
Complex |
addVariable(java.lang.String name,
double re,
double im)
Deprecated. Adds a new complex variable to the parser, or updates the value of an existing variable. |
void |
addVariable(java.lang.String name,
java.lang.Object object)
Deprecated. Adds a new variable to the parser as an object, or updates the value of an existing variable. |
boolean |
getAllowUndeclared()
Deprecated. Returns the value of the allowUndeclared option. |
Complex |
getComplexValue()
Deprecated. Evaluates and returns the value of the expression as a complex number. |
java.lang.String |
getErrorInfo()
Deprecated. Reports information on the errors that occurred during the most recent action. |
FunctionTable |
getFunctionTable()
Deprecated. Returns the function table (the list of all functions that the parser recognizes). |
boolean |
getImplicitMul()
Deprecated. Returns the value of the implicit multiplication option. |
NumberFactory |
getNumberFactory()
Deprecated. Returns the number factory. |
OperatorTableI |
getOperatorSet()
Deprecated. Returns the operator set. |
Parser |
getParser()
Deprecated. Returns the parse object. |
VariableTable |
getSymbolTable()
Deprecated. Returns the symbol table (the list of all variables that the parser recognizes). |
boolean |
getTraverse()
Deprecated. Returns the value of the traverse option. |
double |
getValue()
Deprecated. Evaluates and returns the value of the expression as a double number. |
java.lang.Object |
getValueAsObject()
Deprecated. Evaluates and returns the value of the expression as an object. |
java.lang.Object |
getVarValue(java.lang.String name)
Deprecated. Returns the value of the variable with given name. |
boolean |
hasError()
Deprecated. Returns true if an error occurred during the most recent action (parsing or evaluation). |
void |
initFunTab()
Deprecated. Creates a new FunctionTable object as funTab. |
void |
initSymTab()
Deprecated. Creates a new SymbolTable object as symTab. |
Node |
parseExpression(java.lang.String expression_in)
Deprecated. Parses the expression. |
void |
setAllowUndeclared(boolean value)
Deprecated. Sets the value for the undeclared variables option. |
void |
setImplicitMul(boolean value)
Deprecated. Sets the value of the implicit multiplication option. |
void |
setTraverse(boolean value)
Deprecated. Sets the value of the traverse option. setTraverse is useful for debugging purposes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<java.lang.String> errorList
protected boolean traverse
Constructor Detail |
---|
public JEP()
Traverse = false
Allow undeclared variables = false
Implicit multiplication = false
Number Factory = DoubleNumberFactory
public JEP(boolean traverse_in, boolean allowUndeclared_in, boolean implicitMul_in, NumberFactory numberFactory_in)
traverse_in
- The traverse option.allowUndeclared_in
- The "allow undeclared variables" option.implicitMul_in
- The implicit multiplication option.numberFactory_in
- The number factory to be used.Method Detail |
---|
public void initSymTab()
public void initFunTab()
public void addStandardFunctions()
public void addStandardConstants()
public void addComplex()
public void addFunction(java.lang.String functionName, PostfixMathCommandI function)
functionName
- The name of the functionfunction
- The function object that is used for evaluating the
functionpublic Complex addVariable(java.lang.String name, double re, double im) throws JepException
name
- Name of the variable to be addedre
- Initial real value or new real value for the variableim
- Initial imaginary value or new imaginary value for the variable
JepException
- If a constant with the given name already exists.public void addVariable(java.lang.String name, java.lang.Object object) throws JepException
name
- Name of the variable to be addedobject
- Initial value or new value for the variable
JepException
- If a constant with the given name already exists.public java.lang.Object getVarValue(java.lang.String name)
name
- name of the variable.
public void setTraverse(boolean value)
The default value is false.
value
- The boolean traversal option.public boolean getTraverse()
public void setImplicitMul(boolean value)
"1 2"is valid and is interpreted as
"1*2".
The default value is false.
value
- The boolean implicit multiplication option.public boolean getImplicitMul()
public void setAllowUndeclared(boolean value)
If this option is set to false, variables that were not previously added to JEP will produce an error while parsing.
The default value is false.
value
- The boolean option for allowing undeclared variables.public boolean getAllowUndeclared()
public Node parseExpression(java.lang.String expression_in)
errorList
member.
expression_in
- The input expression string
public double getValue()
getComplexValue()
public Complex getComplexValue()
public java.lang.Object getValueAsObject()
public boolean hasError()
true
if an error occurred during the most
recent action (parsing or evaluation).public java.lang.String getErrorInfo()
public VariableTable getSymbolTable()
public FunctionTable getFunctionTable()
public NumberFactory getNumberFactory()
public OperatorTableI getOperatorSet()
public Parser getParser()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |