All Packages  Class Hierarchy

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Index of all Fields and Methods

A

appendText(String). Method in class Calculator.CalcTextGUI
How to append something to the String currently displayed on the Calculator.

B

ButtonHandler(Calculator). Constructor for class Calculator.ButtonHandler
This constructor sets up a button handler control loop and the myriad objects that will actually do the work.
ButtonLabels. Static variable in interface Calculator.Calculator
An array for the button's labels to deal with dispatch cleanly.
ButtonObj(CalcTextGUI, CalculatorState). Constructor for class Calculator.ButtonObj
How to make one: tell it what GUI and what state object it's working with.

C

CalcTextGUI(Calculator). Constructor for class Calculator.CalcTextGUI
A CalcTextGUI is an adapter for a Calculator, so we'll need a Calculator to adapt on behalf of.
CalculatorState(). Constructor for class Calculator.CalculatorState
CLEAR. Static variable in interface Calculator.Calculator
Calculator clear button.
ClearButtonObj(CalcTextGUI, CalculatorState). Constructor for class Calculator.ClearButtonObj
How to make one: Make a ButtonObj (i.e., my superclass).
clearScreen(). Method in class Calculator.CalcTextGUI
How to clear the Calculator's screen.

D

doneReadingNumber(). Method in class Calculator.CalculatorState
Should be called whenever a non-digit (non-dot) is seen.
doOperation(double, double). Method in class Calculator.OpButtonObj
This method is called when it is actually time to calculate the result of this operation (i.e., by = button).
DOT. Static variable in interface Calculator.Calculator
Calculator decimal point.
DotButtonObj(ButtonObj, CalcTextGUI, CalculatorState). Constructor for class Calculator.DotButtonObj
How to make one: Make a ButtonObj (i.e., my superclass) and also remember that zero button.

E

EqualButtonObj(CalcTextGUI, CalculatorState). Constructor for class Calculator.EqualButtonObj
How to make one: Make a ButtonObj (i.e., my superclass).
EQUALS. Static variable in interface Calculator.Calculator
Calculator = button.

G

getButton(). Method in interface Calculator.Calculator
Get the next Button pressed.
getPendingOperation(). Method in class Calculator.CalculatorState
Accessor ("getter") method for pending operation.
getPreviousOperand(). Method in class Calculator.CalculatorState
Accessor ("getter") method for previous operand.
getText(). Method in class Calculator.CalcTextGUI
How to find out what String is displayed on the Calculator.
getText(). Method in interface Calculator.Calculator
Get the text currently displayed on the Calculator.
getValue(). Method in class Calculator.CalcTextGUI
How to find out what number is displayed on the Calculator.
gui. Variable in class Calculator.ButtonObj
The Calculator-adaptor that this instance can use to get and set text.

H

handleButton(). Method in class Calculator.ButtonObj
How to handle a button.
handleButton(). Method in class Calculator.ClearButtonObj
This method is called by the ButtonHandler whenever the decimal point button is pressed.
handleButton(). Method in class Calculator.DotButtonObj
This method is called by the ButtonHandler whenever the decimal point button is pressed.
handleButton(). Method in class Calculator.EqualButtonObj
This method is called by the ButtonHandler whenever the decimal point button is pressed.
handleButton(). Method in class Calculator.NumButtonObj
This method is called by the ButtonHandler whenever the decimal point button is pressed.
handleButton(). Method in class Calculator.OpButtonObj
This method is called by the ButtonHandler whenever the decimal point button is pressed.

J

justSawDot(). Method in class Calculator.CalculatorState
Should be called when a dot is seen.

L

LAST. Static variable in interface Calculator.Calculator
One more than the biggest button index.

N

NO_OP. Static variable in interface Calculator.Calculator
No operation in progress.
NO_OP_BUTTON_OBJ. Static variable in class Calculator.OpButtonObj
The one and only NOOP button.
noDotYet(). Method in class Calculator.CalculatorState
A test to see if we've seen a decimal place in the number we're currently reading.
notReadingNumber(). Method in class Calculator.CalculatorState
A test to see if state is in middle of reading number.
NumButtonObj(int, CalcTextGUI, CalculatorState). Constructor for class Calculator.NumButtonObj
How to make one: Make a ButtonObj (i.e., my superclass) and also remember my number.

O

OP_ADD. Static variable in interface Calculator.Calculator
Calculator addition.
OP_DIV. Static variable in interface Calculator.Calculator
Calculator division.
OP_MUL. Static variable in interface Calculator.Calculator
Calculator multiplication.
OP_SUB. Static variable in interface Calculator.Calculator
Calculator subtraction.
OpButtonObj(int, ButtonObj, CalcTextGUI, CalculatorState). Constructor for class Calculator.OpButtonObj
How to make one: Make a ButtonObj (i.e., my superclass) and also remember which operation I am (Calculator.OP_ADD, etc.), and always remember that equals button!

R

reset(). Method in class Calculator.CalculatorState
Restores the CalculatorState to its pristine start state.
resetPendingOperation(). Method in class Calculator.CalculatorState
Should be called when no operations are pending, e.g., after = or reset.
run(). Method in class Calculator.ButtonHandler
Called by the ButtonHandler's Thread, this is how this object behaves on an ongoing/independent basis.

S

setPendingOperation(OpButtonObj). Method in class Calculator.CalculatorState
Should be called whenever an operation is seen.
setPreviousOperand(double). Method in class Calculator.CalculatorState
Mutator ("setter") method for previous operand.
setText(String). Method in class Calculator.CalcTextGUI
How to display a String on the Calculator.
setText(String). Method in interface Calculator.Calculator
Set the text currently displayed on the Calculator.
startReadingNumber(). Method in class Calculator.CalculatorState
Should be called whenever a first digit is seen.
stateObj. Variable in class Calculator.ButtonObj
The CalculatorState that keeps track of what's going on in the behavior of the Calculator that this ButtonObj belongs to.