Class infixModel.CompState
- class CompState
- extends infixModel.ACalcState
State where the calculator has computed a result

Singleton
- Singleton instance

CompState
()
- Hidden constructor

enterDigit
(InfixCalc, char)
- Appends c to the string of digit collected so far if not zero
enterEqual
(InfixCalc)
- Syntax error
enterOp
(InfixCalc, IBinOp)
- Performs the pending operation, and set op as the next pending operation
enterPoint
(InfixCalc)
- Enters a decimal point

Singleton
public static final CompState Singleton = new CompState()
- Singleton instance

CompState
private CompState()
- Hidden constructor

enterDigit
public void enterDigit(InfixCalc calc, char c)
- Appends c to the string of digit collected so far if not zero.
If zero, then set display to "0" and return to start state.
- Parameters:
- calc - The calculator model (context)
- c - The digit being entered
enterOp
public void enterOp(InfixCalc calc, IBinOp op)
- Performs the pending operation, and set op as the next pending operation
on whatever is computed so far to the operand that will be entered next.
Go to error if the number in the display does not parse properly into a floating point number.
- Parameters:
- calc - The calculator model (context)
- op - New pending operation
enterEqual
public void enterEqual(InfixCalc calc)
- Syntax error. Set display to "Syntax error" and
go to error state.
- Parameters:
- calc - The calculator model (context)
enterPoint
public void enterPoint(InfixCalc calc)
- Enters a decimal point. Set display ot "0." and go to point state.
- Parameters:
- calc - The calculator model (context)