|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExpressionCommand
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 |
---|
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.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.int extent(ExpressionProgram prog, int myIndex)
prog
- ExpressionProgram in which this ExpressionCommand occurs.myIndex
- index at which ExpressionCommand occurs in prog.
boolean dependsOn(Variable x)
x
- variable to check
void appendOutputString(ExpressionProgram prog, int myIndex, java.lang.StringBuffer buffer)
prog
- program containing the expressionmyIndex
- location of the expressionbuffer
- string to append
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |