|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Performs calculator's operation. All calculator's operations must implement this interface
Calculator| Method Summary | |
boolean |
isInvokedImmediately()
Returns true if the operation should be executed immediately and not waiting for
the second operand. |
boolean |
isRepeatable()
Returns true if the operation is repeatable. |
boolean |
isShowResult()
Returns true if the operation's result should be shown on
the CalculatorPanel display |
boolean |
isStandalone()
Returns true if the operation is standalone. |
java.math.BigDecimal |
performOperation(Calculator aCalculator,
java.math.BigDecimal aFirstOperand,
java.math.BigDecimal aSecondOperand)
Performs calculator's operation |
| Method Detail |
public java.math.BigDecimal performOperation(Calculator aCalculator,
java.math.BigDecimal aFirstOperand,
java.math.BigDecimal aSecondOperand)
throws CalculatorException
aCalculator - Calculator instanceaFirstOperand - first operand. Comes from the calculator's state mapaSecondOperand - second operand. Comes from the CalculatorPanel display
CalculatorExceptionpublic boolean isInvokedImmediately()
true if the operation should be executed immediately and not waiting for
the second operand. For example SQRT, 1/x
true if the operation should be executed immediatelypublic boolean isStandalone()
true if the operation is standalone. Standalone operations perform
computations and calculator's state map changes itself returning the result of its computation.
Nonstandalone operations just perform computations on two operandsands (like subtraction and
multiplication), return the result of its computation and do nothing with calculator's state map.
Calculator decides itself can this operation be performed immediately or put to the state map
to be performed later when second operand is received
true if the operation is standalone.public boolean isShowResult()
true if the operation's result should be shown on
the CalculatorPanel display
true if the operation's result should be shownpublic boolean isRepeatable()
true if the operation is repeatable. Repeatable means that the operation
can be put in the calculator state map and repeat again with a new fist operand by clcking
equal button. For example 2+3=5. Next click on equal will return 8 (5+3), next 11 (8+3) and
so on
true if the operation is repeatable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||