"Hello, Amigo!"
12
Task
Java Core, level 9, lesson 3
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
Task
Java Core, level 9, lesson 3
Adapter
Use the AdapterFileOutputStream class to adapt FileOutputStream to the new AmigoStringWriter interface.
20
Task
Java Core, level 9, lesson 3
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
Task
Java Core, level 9, lesson 3
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
Task
Java Core, level 9, lesson 3
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