12
Gawain
Java Core, antas, aralin
TableAdapter
Edit the TableAdapter class so that it adapts the ATable interface to the BTable interface.
The getHeaderText method should return "[] : ".
For example, "[Amigo] : DashboardTable".
12
Gawain
Java Core, antas, aralin
Adapter
Use the AdapterFileOutputStream class to adapt FileOutputStream to the new AmigoStringWriter interface.
20
Gawain
Java Core, antas, aralin
Adapting multiple interfaces
Adapt IncomeData to the Customer and Contact interfaces.
The adapter class is IncomeDataAdapter.
Initialize countries before running the program. Mapping between country codes and country names:
UA Ukraine
US United States
FR France
If necessary, pad phone numbers with zeros to get 10 digits long (s
20
Gawain
Java Core, antas, aralin
Yet another adapter
Adapt Scanner to the PersonScanner interface.
The adapter class is PersonScannerAdapter.
Create a private final Scanner field called fileScanner in the adapter class. Initialize the field in a constructor with one Scanner parameter.
The file stores data in the following format:
John Michael Peterson
20
Gawain
Java Core, antas, aralin
Reinforce the adapter
Adapt Customer and Contact to RowItem.
The adapter class is DataAdapter.
Initialize countries before running the program. Mapping between country codes and country names:
UA Ukraine
US United States
FR France