Logo Search packages:      
Sourcecode: wims version File versions  Download package

edu::hws::jcm::functions::WrapperFunction Class Reference

Inheritance diagram for edu::hws::jcm::functions::WrapperFunction:

edu::hws::jcm::functions::FunctionParserExtension edu::hws::jcm::data::Function edu::hws::jcm::data::ParserExtension edu::hws::jcm::data::ExpressionCommand edu::hws::jcm::data::MathObject

List of all members.

Detailed Description

A WrapperFunction contains another function and delegates to it all calls to methods from the Function interface, except for calls to setName() and getName(). (It maintains its own name, which can be different from the name of the wrapped Function.) This has at least two uses: A WrapperFunction is a FunctionParserExtension, so it can be added to a parser and then used in expressions parsed in that parser. Second, the function that is wrapped inside the WrapperFunction object can be changed by a call to the setFunction() method. This makes it possible to have a single function that can be used, for example, in ValueMath objects and Graph1D's, whose definition can be changed at will. Note that it is NOT legal to change the arity of the function when calling the setFunction() method.

Definition at line 43 of file WrapperFunction.java.

Public Member Functions

void appendOutputString (ExpressionProgram prog, int myIndex, StringBuffer buffer)
void apply (StackOfDouble stack, Cases cases)
void compileDerivative (ExpressionProgram prog, int myIndex, ExpressionProgram deriv, Variable wrt)
boolean dependsOn (Variable x)
Function derivative (Variable x)
Function derivative (int wrt)
void doParse (Parser parser, ParserContext context)
int extent (ExpressionProgram prog, int myIndex)
int getArity ()
Function getFunction ()
String getName ()
double getVal (double[] arguments)
double getValueWithCases (double[] arguments, Cases cases)
void setFunction (Function f)
void setName (String name)
void setParensCanBeOptional (boolean b)
 WrapperFunction (Function f)

Protected Attributes

String name

Private Member Functions

void check ()

Private Attributes

int derivativeIndex
WrapperFunction derivativeOf
Variable derivativeVar
Function func
double[] params
int serialNumber

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index