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

Constructor Index

 o CalcTextGUI(Calculator)
A CalcTextGUI is an adapter for a Calculator, so we'll need a Calculator to adapt on behalf of.

Method Index

 o appendText(String)
How to append something to the String currently displayed on the Calculator.
 o clearScreen()
How to clear the Calculator's screen.
 o getText()
How to find out what String is displayed on the Calculator.
 o getValue()
How to find out what number is displayed on the Calculator.
 o setText(String)
How to display a String on the Calculator.

Constructors

 o 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.

Methods

 o setText
 public void setText(String s)
How to display a String on the Calculator.

Parameters:
s - The string to be displayed.
 o getText
 public String getText()
How to find out what String is displayed on the Calculator.

Returns:
s The string currently being displayed.
 o getValue
 public double getValue()
How to find out what number is displayed on the Calculator.

Returns:
s A double representing the currently displayed value.
 o 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.
 o clearScreen
 public void clearScreen()
How to clear the Calculator's screen.


All Packages  Class Hierarchy  This Package  Previous  Next  Index