public class Add extends PostfixMathCommand
curNumberOfParameters, numberOfParameters| Constructor and Description |
|---|
Add() |
| Modifier and Type | Method and Description |
|---|---|
Complex |
add(Complex c1,
Complex c2) |
Complex |
add(Complex c,
Number d) |
Double |
add(Number d1,
Number d2) |
Object |
add(Object param1,
Object param2)
Adds two numbers together.
|
void |
run(Stack stack)
Calculates the result of applying the "+" operator to the arguments from
the stack and pushes it back on the stack.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameterspublic void run(Stack stack) throws ParseException
run in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionpublic Object add(Object param1, Object param2) throws ParseException
param1 - The first parameter to be added.param2 - The second parameter to be added.ParseExceptionCopyright © 2018. All rights reserved.