|
Calculator Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for a basic four-function calculator, as seen from the perspective of its logic. This interface defines an enumerated type, buttonIDs (including 0...9, which represent themselves), an array of ButtonLabels suitable for displaying on the GUI, and the three access functions by which the logic can manipulate the Calculator: getButton, getText, and setText.
CalculatorGUI
Field Summary | |
static java.lang.String[] |
ButtonLabels
An array for the button's labels to deal with dispatch cleanly. |
static int |
CLEAR
Calculator clear button. |
static int |
DOT
Calculator decimal point. |
static int |
EQUALS
Calculator = button. |
static int |
LAST
One more than the biggest button index. |
static int |
NO_OP
No operation in progress. |
static int |
OP_ADD
Calculator addition. |
static int |
OP_DIV
Calculator division. |
static int |
OP_MUL
Calculator multiplication. |
static int |
OP_SUB
Calculator subtraction. |
Method Summary | |
int |
getButton()
Get the next Button pressed. |
java.lang.String |
getText()
Get the text currently displayed on the Calculator. |
void |
setText(java.lang.String newText)
Set the text currently displayed on the Calculator. |
Field Detail |
public static final int NO_OP
public static final int OP_DIV
public static final int OP_MUL
public static final int OP_ADD
public static final int OP_SUB
public static final int DOT
public static final int EQUALS
public static final int CLEAR
public static final int LAST
public static final java.lang.String[] ButtonLabels
Method Detail |
public int getButton()
public java.lang.String getText()
public void setText(java.lang.String newText)
newText
- the text to be displayed.
|
Calculator Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |