public final class MathMLExpression
extends java.lang.Object
<apply>
tag.Constructor and Description |
---|
MathMLExpression()
Constructs a MathML expression.
|
Modifier and Type | Method and Description |
---|---|
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.Hashtable 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.
|
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.Hashtable vars)
vars
- a hashtable of variables and values to substitute.public java.lang.Object evaluate()