calculator
Class CalculatorState
java.lang.Object
calculator.CalculatorState
- public class CalculatorState
- extends java.lang.Object
This class provides the main functionality for a basic four-function
calculator. Adapted from the earlier ButtonHandler
Copyright (c) 1999 Massachusetts Institute of Technology
- Version:
- $Id: CalculatorState.java,v 1.2 2003/03/28 17:25:06 gus Exp $
- Author:
- Todd C. Parnell, tparnell@ai.mit.edu, Emil Sit, sit@mit.edu, Lynn Andrea Stein, las@ai.mit.edu
- See Also:
Calculator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
seenDecimal
protected boolean seenDecimal
readyForNewNumber
protected boolean readyForNewNumber
previousNumber
protected double previousNumber
operation
protected int operation
CalculatorState
protected CalculatorState(Calculator gui)
toString
public java.lang.String toString()
handleNumKey
protected void handleNumKey(int num)
handleDecimal
protected void handleDecimal()
handleOperation
protected void handleOperation(int op)
handleEquals
protected void handleEquals()
doOperation
protected double doOperation(double currentNumber)
resetDecimal
protected void resetDecimal()
clearScreen
protected void clearScreen()
readScreen
protected java.lang.String readScreen()
writeScreen
protected void writeScreen(java.lang.String s)
writeScreen
protected void writeScreen(double d)
writeScreen
protected void writeScreen(int i)
resetCalc
protected void resetCalc()