Class AddressDataHandler
java.lang.Object
de.hdm_stuttgart.mi.sd1.htmlformat.AddressDataHandler
Reading address data from text file data source.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAddressDataHandler
(String filename) Parsing text file address data having the following format: -
Method Summary
Modifier and TypeMethodDescriptionvoid
printAddresses
(PrintStream out, AddressFormatter formatter) Format the set of address records and write the result to a stream.
-
Field Details
-
addresses
Available address records.
-
-
Constructor Details
-
AddressDataHandler
public AddressDataHandler(String filename) throws FileNotFoundException, IOException, AddressParseError Parsing text file address data having the following format:"firstName","lastName","companyName","address","city","county","postal","phone1","phone2","email","web"
The first line is expected to contain the above description and will be ignored.- Parameters:
filename
- Address data source.- Throws:
IOException
- Input file cannot be readFileNotFoundException
- File does not existAddressParseError
- Input data file parse error
-
-
Method Details
-
printAddresses
Format the set of address records and write the result to a stream.- Parameters:
out
- Desired output streamformatter
- Formatting instance (may e.g. be text, HTML,...)
-