|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.io.MathMLExpression
public final class MathMLExpression
The MathMLExpression class is used by the MathMLParser to
encapsulate math expressions described by the <apply>
tag.
Constructor Summary | |
---|---|
MathMLExpression()
Constructs a MathML expression. |
Method Summary | |
---|---|
void |
addArgument(java.lang.Object obj)
Adds an argument to this expression. |
java.lang.Object |
evaluate()
Evaluates this expression. |
java.lang.Object |
getArgument(int n)
Returns an argument from this expression. |
java.lang.String |
getOperation()
Returns the operation to be applied to the arguments. |
int |
length()
Returns the number of arguments. |
void |
setOperation(java.lang.String op)
Set the operation to be applied to the arguments. |
MathMLExpression |
substitute(java.util.Map vars)
Substitutes several values for variables in this expression. |
MathMLExpression |
substitute(java.lang.String var,
java.lang.Object value)
Substitutes a value for a variable in this expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MathMLExpression()
Method Detail |
---|
public void setOperation(java.lang.String op)
op
- a MathML tag name
(plus
, minus
, times
, divide
, etc).public java.lang.String getOperation()
public void addArgument(java.lang.Object obj)
public java.lang.Object getArgument(int n)
public int length()
public MathMLExpression substitute(java.lang.String var, java.lang.Object value)
var
- the variable to substitute for.value
- the value of the variable.
public MathMLExpression substitute(java.util.Map vars)
vars
- a hashtable of variables and values to substitute.
public java.lang.Object evaluate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |