public class SummationParser extends Object implements ParserExtension
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).)
| Constructor and Description |
|---|
SummationParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
doParse(Parser parser,
ParserContext context)
When the name of this ParserExtension is encountered by a parser with which
the extension is registered, the parser calls this routine to parse the
summation subexpression.
|
String |
getName()
Get the name, which will be used in place of "sum" in expressions.
|
void |
setName(String name)
Set the name, which will be used in place of "sum" in expressions.
|
public void setName(String name)
setName in interface MathObjectpublic String getName()
getName in interface MathObjectpublic void doParse(Parser parser, ParserContext context)
doParse in interface ParserExtension