Package sc2002.FCS1.grp2
Interface CSVEncodable
- All Known Implementing Classes:
Applicant,Application,BTOProject,Enquiry,FlatInfo,HDBManager,HDBOfficer,Message,User
public interface CSVEncodable
The purpose of this interface is to provide a set of common functionality for the
CSVEncoder class to encode objects for generating a CSV file, that is compliant for future parsing.
This allows for a consistent CSV file encoding experience, of which all encodable files should subscribe to.-
Method Summary
Modifier and TypeMethodDescriptionencode()Override this to provide a line/row of CSV content.Override this to provide which file type the encodable class should be represented as.
-
Method Details
-
encode
String encode()Override this to provide a line/row of CSV content. This will be called one by one in theCSVEncoder, to be written in file.- Returns:
- A CSV row, in
Stringtext.
-
sourceFileType
CSVFileTypes sourceFileType()Override this to provide which file type the encodable class should be represented as. This ensures that the right data is written in the right file, depending on the class type.- Returns:
- a CSVFileType, such as
CSVFileType.MANAGER_LIST.
-