All Packages Class Hierarchy This Package Previous Next Index
Class Calculator.CalcTextGUI
java.lang.Object
|
+----Calculator.CalcTextGUI
- public class CalcTextGUI
- extends Object
This class is a text-only adapter for the Calculator GUI. Each ButtonHandler
should have exactly one instance of CalcTextGUI. This provides the basic text
functionality present in the Calculator interface (though not the getButton()
method) as well as some additional utility functions.
- See Also:
- Calculator
-
CalcTextGUI(Calculator)
- A CalcTextGUI is an adapter for a Calculator, so we'll need a
Calculator to adapt on behalf of.
-
appendText(String)
- How to append something to the String currently displayed on the
Calculator.
-
clearScreen()
- How to clear the Calculator's screen.
-
getText()
- How to find out what String is displayed on the Calculator.
-
getValue()
- How to find out what number is displayed on the Calculator.
-
setText(String)
- How to display a String on the Calculator.
CalcTextGUI
public CalcTextGUI(Calculator realGUI)
- A CalcTextGUI is an adapter for a Calculator, so we'll need a
Calculator to adapt on behalf of. Otherwise, vanilla construction.
- Parameters:
- realGUI - the Calculator to adapt.
setText
public void setText(String s)
- How to display a String on the Calculator.
- Parameters:
- s - The string to be displayed.
getText
public String getText()
- How to find out what String is displayed on the Calculator.
- Returns:
- s The string currently being displayed.
getValue
public double getValue()
- How to find out what number is displayed on the Calculator.
- Returns:
- s A double representing the currently displayed value.
appendText
public void appendText(String s)
- How to append something to the String currently displayed on the
Calculator.
- Parameters:
- s - The string to be appended.
clearScreen
public void clearScreen()
- How to clear the Calculator's screen.
All Packages Class Hierarchy This Package Previous Next Index