|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.sbml.jep.JEP
public class JEP
The JEP class is the main interface with which the user should interact. It contains all neccessary methods to parse and evaluate expressions.
The most important methods are parseExpression(String), for parsing the mathematical expression, and getValue() for obtaining the value of the expression. Visit http://jep.sourceforge.net/ for the newest version of JEP, and complete documentation. This is an edited and enhanced version not aligned with the sourceforge project.
| Field Summary | |
|---|---|
protected java.util.Vector |
errorList
Error List |
protected FunctionTable |
funTab
Function Table |
protected boolean |
implicitMul
Implicit multiplication option |
protected java.util.Hashtable |
symTab
Symbol Table |
| Constructor Summary | |
|---|---|
JEP()
Creates a new JEP instance with the default settings. |
|
JEP(boolean traverse_in,
boolean allowUndeclared_in,
boolean implicitMul_in,
NumberFactory numberFactory_in)
Creates a new JEP instance with custom settings. |
|
| Method Summary | |
|---|---|
void |
addFunction(java.lang.String functionName,
PostfixMathCommandI function)
Adds a new function to the parser. |
void |
addStandardFunctions()
Adds the standard functions to the parser. |
java.lang.String |
getErrorInfo()
Reports information on the errors that occured during the most recent action. |
NumberFactory |
getNumberFactory()
Returns the number factory. |
java.lang.String |
getSBMLString(java.lang.String expression_in)
|
Node |
getTopNode()
Returns the top node of the expression tree. |
java.util.Enumeration |
getVariables()
|
java.util.Enumeration |
getVariablesInExpression(java.lang.String eq)
Gets the variables in the given equation. |
boolean |
hasError()
Returns true if an error occured during the most recent action (parsing or evaluation). |
void |
initFunTab()
Creates a new FunctionTable object as funTab. |
boolean |
isFunction(java.lang.String s)
|
static boolean |
isMathMLFunction(java.lang.String s)
|
void |
parseExpression(java.lang.String expression_in)
Parses the expression. |
java.lang.Object |
removeFunction(java.lang.String name)
Removes a function from the parser. |
void |
setImplicitMul(boolean value)
Sets the value of the implicit multiplication option. |
void |
setTraverse(boolean value)
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 boolean implicitMul
protected FunctionTable funTab
protected java.util.Hashtable symTab
protected java.util.Vector errorList
| Constructor Detail |
|---|
public JEP()
public JEP(boolean traverse_in,
boolean allowUndeclared_in,
boolean implicitMul_in,
NumberFactory numberFactory_in)
traverse_in - The traverse option.implicitMul_in - The implicit multiplication option.numberFactory_in - The number factory to be used.| Method Detail |
|---|
public static boolean isMathMLFunction(java.lang.String s)
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 void addStandardFunctions()
public java.lang.String getErrorInfo()
public NumberFactory getNumberFactory()
public java.lang.String getSBMLString(java.lang.String expression_in)
public Node getTopNode()
public java.util.Enumeration getVariables()
public java.util.Enumeration getVariablesInExpression(java.lang.String eq)
eq - The equation.
public boolean hasError()
true if an error occured during the most recent action (parsing or evaluation).public void initFunTab()
public boolean isFunction(java.lang.String s)
public void parseExpression(java.lang.String expression_in)
errorList member.
expression_in - The input expression stringpublic java.lang.Object removeFunction(java.lang.String name)
null is
returned.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 void setTraverse(boolean value)
value - The boolean traversal option.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||