|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.hws.jcm.awt.ExpressionInput.EI
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.
| Method Summary | |
boolean |
dependsOn(Variable x)
Checks whether the expression has any dependence on the variable x. |
Expression |
derivative(Variable wrt)
Return an Expression that represents the derivative of this expression with respect to the variable wrt. |
double |
getVal()
Gets the current value of this object. |
double |
getValueWithCases(Cases c)
Compute and return the value of this expression. |
java.lang.String |
toString()
Get a print string representation of this expression. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public double getVal()
ValuegetVal in interface Valuepublic double getValueWithCases(Cases c)
ExpressiongetValueWithCases in interface Expressionpublic java.lang.String toString()
ExpressiontoString in interface ExpressiontoString in class java.lang.Objectpublic Expression derivative(Variable wrt)
Expressionderivative in interface Expressionpublic boolean dependsOn(Variable x)
ExpressiondependsOn in interface Expression
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||