|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An ExpressionCommand can occur as a command in an ExpressionProgram. ExpressionCommands exists so that ExprssionPrograms can be extened to include new types of operations beyond the basic operations (such as PLUS and SIN) which are represented by constants in the ExpressionProgram class. Examples include ConditionalExpressions and user-defined functions. This interface is not meant for casual programmers. It is for programmers who want to extend the notion of Expression in an orginal way.
Method Summary | |
void |
appendOutputString(ExpressionProgram prog,
int myIndex,
java.lang.StringBuffer buffer)
The ExpressionCommand occurs in the program prog at the index indicated by myIndex. |
void |
apply(StackOfDouble stack,
Cases cases)
This routine is called when an ExpressionCommand object is encountered during the evaluation of an ExpressionProgram. |
void |
compileDerivative(ExpressionProgram prog,
int myIndex,
ExpressionProgram deriv,
Variable wrt)
The ExpressionCommand occurs in the program prog at the index indicated by myIndex. |
boolean |
dependsOn(Variable x)
Return true if this command depends on the value of x, false otherwise. |
int |
extent(ExpressionProgram prog,
int myIndex)
The ExpressionCommand occurs in the program prog at the index indicated by myIndex. |
Method Detail |
public void apply(StackOfDouble stack, Cases cases)
stack
- contains results of previous commands in the program.cases
- if non-null, any case information generated during evaluation should be recorded here.public void compileDerivative(ExpressionProgram prog, int myIndex, ExpressionProgram deriv, Variable wrt)
prog
- program in which ExpressionCommand occurs.myIndex
- point at which ExpressionCommand occurs in the ExpressionProgram.deriv
- the derivative of the ExpressionPorgram prog, which is in the process of being computed.
Commands should added to deriv that will compute the derivative of this ExpressionCommand.wrt
- commands are added to deriv with respect to this Variable.public int extent(ExpressionProgram prog, int myIndex)
prog
- ExpressionProgram in which this ExpressionCommand occurs.myIndex
- index at which ExpressionCommand occurs in prog.public boolean dependsOn(Variable x)
public void appendOutputString(ExpressionProgram prog, int myIndex, java.lang.StringBuffer buffer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |