| edu.hws.jcm.data.Expression
All known Subclasses: edu.hws.jcm.data.ExpressionProgram, edu.hws.jcm.data.Constant,
Expression | public interface Expression extends Value(Code) | | An Expression represents a mathematical expression such as "x+1" or
"3" or "sin(x*ln(x)-3*abs(x/4))". An expression has a value, which
can depend on the values of variables that occur in the expression.
An expression can be differenetiated with respect to a variable. It has
a print string representation. This interface is implemented by
the classes Constant, Variable, and ExpressionProgram, for example.
The Expression interface
represents all the properties of expressions that you are likely to need
to know about, unless you want to write a new kind of ExpressionCommand.
|
Method Summary | |
public boolean | dependsOn(Variable x) Checks whether the expression has any dependence on the variable x. | public Expression | derivative(Variable wrt) Return an Expression that represents the derivative of
this expression with respect to the variable wrt. | public double | getValueWithCases(Cases cases) Compute and return the value of this expression. | public String | toString() Get a print string representation of this expression. |
dependsOn | public boolean dependsOn(Variable x)(Code) | | Checks whether the expression has any dependence on the variable x.
|
derivative | public Expression derivative(Variable wrt)(Code) | | Return an Expression that represents the derivative of
this expression with respect to the variable wrt.
(Note that if the expression contains other variables
besides wrt, this is actually a partial derivative.)
|
getValueWithCases | public double getValueWithCases(Cases cases)(Code) | | Compute and return the value of this expression. If cases is non-null,
then data is stored in cases that can be used to check for possible
discontinuities between one evaluation and the next. See the class
Cases for more information.
|
toString | public String toString()(Code) | | Get a print string representation of this expression. (Of course,
every object defines toString(). It is included here to remind you
that classes that implement the Expression interface should have
a print string representation that looks like a mathematical
expression.)
|
|
|