Package edu.hws.jcm.awt
Class ExpressionInput.EI
java.lang.Object
edu.hws.jcm.awt.ExpressionInput.EI
- All Implemented Interfaces:
Expression,Value,Serializable
- Enclosing class:
ExpressionInput
The expression associated with an ExpressionInput belongs to this class.
So is any derivative of such a function. Note that derivatives
must be recomputed when the expression changes. This is done
via "lazy evaluation", that is, only when necessary. When
a derivative is used, it tests whether it is out of date
by comparing its serialNumber to the serial number of the
expression that it is the derivative of. If they don't match,
then the expression is recomputed and the serial number is updated.
The serial number and defintion of the main expresssion is changed by
checkInput() whenever the user's input has changed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the expression has any dependence on the variable x.derivative(Variable wrt) Return an Expression that represents the derivative of this expression with respect to the variable wrt.doublegetVal()Gets the current value of this object.doubleCompute and return the value of this expression.toString()Get a print string representation of this expression.
-
Method Details
-
getVal
public double getVal()Description copied from interface:ValueGets the current value of this object. -
getValueWithCases
Description copied from interface:ExpressionCompute 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.- Specified by:
getValueWithCasesin interfaceExpression
-
toString
Description copied from interface:ExpressionGet 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.)- Specified by:
toStringin interfaceExpression- Overrides:
toStringin classObject
-
derivative
Description copied from interface:ExpressionReturn 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.)- Specified by:
derivativein interfaceExpression
-
dependsOn
Description copied from interface:ExpressionChecks whether the expression has any dependence on the variable x.- Specified by:
dependsOnin interfaceExpression
-