Class CalculatorEngine
java.lang.Object
org.eclipse.nebula.widgets.opal.calculator.CalculatorEngine
class CalculatorEngine
extends java.lang.Object
This is the calculator engine
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
OPERATOR_DIVIDE
(package private) static java.lang.String
OPERATOR_MINUS
(package private) static java.lang.String
OPERATOR_MULTIPLY
(package private) static java.lang.String
OPERATOR_PLUS
-
Constructor Summary
Constructors Constructor Description CalculatorEngine(CalculatorButtonsComposite composite)
Constructor -
Method Summary
Modifier and Type Method Description void
cancel()
(package private) void
processEquals()
Process equals operation(package private) void
processInverseOperation()
Process 1/x operation(package private) void
processOperation(java.lang.String operator)
(package private) void
processPerCentageOperation()
Process percentage operation(package private) void
processSignChange()
Process +/- operation(package private) void
processSquareRootOperation()
Process square root operation
-
Field Details
-
OPERATOR_PLUS
static final java.lang.String OPERATOR_PLUS- See Also:
- Constant Field Values
-
OPERATOR_MINUS
static final java.lang.String OPERATOR_MINUS- See Also:
- Constant Field Values
-
OPERATOR_MULTIPLY
static final java.lang.String OPERATOR_MULTIPLY- See Also:
- Constant Field Values
-
OPERATOR_DIVIDE
static final java.lang.String OPERATOR_DIVIDE- See Also:
- Constant Field Values
-
-
Constructor Details
-
CalculatorEngine
CalculatorEngine(CalculatorButtonsComposite composite)Constructor- Parameters:
calculator
- calculator widget associated to this engine
-
-
Method Details
-
processEquals
void processEquals()Process equals operation -
processInverseOperation
void processInverseOperation()Process 1/x operation -
processOperation
void processOperation(java.lang.String operator)- Parameters:
operator
- operation to process
-
processPerCentageOperation
void processPerCentageOperation()Process percentage operation -
processSignChange
void processSignChange()Process +/- operation -
processSquareRootOperation
void processSquareRootOperation()Process square root operation -
cancel
public void cancel()
-