package Calculator; public class CalculatorState { private OpButtonObj pendingOperation = OpButtonObj.NO_OP_BUTTON_OBJ; private double previousOperand = 0; private boolean readingNumber = false, seenDot = false; public void reset() { this.pendingOperation = OpButtonObj.NO_OP_BUTTON_OBJ; this.previousOperand = 0; this.readingNumber = false; this.seenDot = false; } public void startReadingNumber() { this.readingNumber = true; this.seenDot = false; } public void doneReadingNumber() { readingNumber = false; } public boolean notReadingNumber() { return ( ! this.readingNumber ); } public boolean noDotYet() { return !this.seenDot; } public void justSawDot() { this.seenDot = true; } public void setPendingOperation( OpButtonObj currOp ) { this.pendingOperation = currOp; } public void resetPendingOperation() { this.pendingOperation = OpButtonObj.NO_OP_BUTTON_OBJ; } public OpButtonObj getPendingOperation() { return this.pendingOperation; } public void setPreviousOperand( double num ) { this.previousOperand = num; } public double getPreviousOperand() { return this.previousOperand; } }