java.lang.Object | +--CalculatorChip
Provides the basic operations for a four-function, octal/decimal/hexadecimal calculator.
| Constructor Summary | |
CalculatorChip()
|
|
| Method Summary | |
(package private) java.lang.String |
clearAll()
Completely resets the calculator. |
(package private) java.lang.String |
clearEntry()
Zeros the number in the display, but otherwise leaves the calculator in the same state that it was in. |
(package private) java.lang.String |
digitClick(char digitChar)
Starts the display with the digit or appends it to the number already in the display. |
(package private) java.lang.String |
equalsClick()
Handles the equals key. |
(package private) java.lang.String |
operatorClick(char operator)
Stores the operator (represented by one of the characters '+', '-', '*', or '/') so that it can be applied later to the operands. |
(package private) java.lang.String |
setBase(int base)
Sets the calculator to display values in the given base, and returns the new display string. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public CalculatorChip()
| Method Detail |
java.lang.String clearAll()
java.lang.String clearEntry()
java.lang.String digitClick(char digitChar)
digitChar - a character representing the new digit.java.lang.String equalsClick()
java.lang.String operatorClick(char operator)
operator - a character representing the operator to be stored.java.lang.String setBase(int base)
base - the base to use, which must be 8, 10, or 16.