org.nfunk.jep.function
Class Sum
java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.nfunk.jep.function.Sum
- All Implemented Interfaces:
- PostfixMathCommandI
public class Sum
- extends PostfixMathCommand
This class serves mainly as an example of a function that accepts any number
of parameters. Note that the numberOfParameters is initialized to -1.
|
Constructor Summary |
Sum()
Constructor. |
|
Method Summary |
void |
run(Stack stack)
Calculates the result of summing up all parameters, which are assumed to
be of the Double type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sum
public Sum()
- Constructor.
run
public void run(Stack stack)
throws ParseException
- Calculates the result of summing up all parameters, which are assumed to
be of the Double type.
- Specified by:
run in interface PostfixMathCommandI- Overrides:
run in class PostfixMathCommand
- Throws:
ParseException
Copyright © 2014. All rights reserved.