|
|||||||||
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()
Value
getVal
in interface Value
public double getValueWithCases(Cases c)
Expression
getValueWithCases
in interface Expression
public java.lang.String toString()
Expression
toString
in interface Expression
toString
in class java.lang.Object
public Expression derivative(Variable wrt)
Expression
derivative
in interface Expression
public boolean dependsOn(Variable x)
Expression
dependsOn
in interface Expression
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |