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

edu::hws::jcm::functions::SummationParser Class Reference

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

edu::hws::jcm::data::ParserExtension edu::hws::jcm::data::MathObject

List of all members.


Detailed Description

The SummationParser class makes it possible to use summations such as sum(i,1,5,x^i) in a Parser. The summation psedu-function has four parameters: (1) The summation variable, which must be an identifier; (2) The lower limit for the summation, given as an expression; (3) The upper limit for the summation, given as an expression; and (4) The expression that is summed. The values of the lower and upper limit expressions are rounded to the nearest integer. The expression in the fourth parameter can (and presumably will) use the summation variable (as well as other identifiers known to the parser).

To use summations with a Parser p, just say p.add(new SummationParser()). It's unlikely that you will ever need to do anything else with SummationParsers. If you want to use a name other than "sum", you can change the name after creating the SummationParser object but before adding it to a parser. (Note, by the way, that parsers by default do not do factorials. If you want a parser that recognizes factorials, you could do something like p = new Parser(Parser.DEFAULT_OPTIONS | Parser.FACTORIAL).)

Definition at line 49 of file SummationParser.java.


Public Member Functions

void doParse (Parser parser, ParserContext context)
String getName ()
void setName (String name)

Private Attributes

String name = "sum"

Classes

class  Cmd

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

Generated by  Doxygen 1.6.0   Back to index