All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Calculator.EqualButtonObj

java.lang.Object
   |
   +----Calculator.ButtonObj
           |
           +----Calculator.EqualButtonObj

public class EqualButtonObj
extends ButtonObj
This class is a smart button object that handles the Calculator's equal sign. Every ButtonHandler should have one.

See Also:
Calculator

Constructor Index

 o EqualButtonObj(CalcTextGUI, CalculatorState)
How to make one: Make a ButtonObj (i.e., my superclass).

Method Index

 o handleButton()
This method is called by the ButtonHandler whenever the decimal point button is pressed.

Constructors

 o EqualButtonObj
 public EqualButtonObj(CalcTextGUI gui,
                       CalculatorState stateObj)
How to make one: Make a ButtonObj (i.e., my superclass). This constructor exists only to call super w/the appropriate arguments.

Parameters:
gui - The CalcTextGUI to keep track of.
stateObj - The CalculatorState to keep track of.

Methods

 o handleButton
 public void handleButton()
This method is called by the ButtonHandler whenever the decimal point button is pressed.

How to handle (my button) being pressed? If there's an operation pending (but not yet done), do it to the remembered previousOperand and the current operand (sitting on the calculator's screen). The result goes on the calculator's screen, there is no longer a pending operation, etc.

Overrides:
handleButton in class ButtonObj

All Packages  Class Hierarchy  This Package  Previous  Next  Index