Question: For all files and paths, use the Files and Paths APIs from the java.nio.file package when possible. B The following private fields: 1 A static

For all files and paths, use the Files and Paths APIs from the java.nio.file package when possible.
B The following private fields:
1 A static constant path for the base directories, which are db sub tables relative to the project directory.
2 A path for the flat file, which is the table file structure in CSV format.
3 No fields for the degree, size, fingerprint, or any other fields (unlike in previous modules).
C A 2-ary constructor which takes a name parameter (string) and a columns parameter (list of strings).
1 Create the base directories, if needed.
2 Initialize the path field by resolving the given name plus the .csv extension relative to the base directories.
3 If the flat file doesnt exist at the path field, create it.
4 Join the columns parameter into a header record (line) using commas (,). Dont use quotation marks.
5 Create a list of records (list of lines) with the header as its only record.
6 Write the list of records to the flat file.
D A 1-ary constructor which takes a name parameter (string) only.
1 Initialize the path field by resolving the given name plus the .csv extension relative to the base directories.
2 If the flat file doesnt exist at the path field, throw an illegal argument exception.
E A public clear method.
1 Read all records (lines) from the flat file into a list of records.
2 Clear all records from the list of records, retaining only the header.
3 Write the modified list of records to the flat file.
F Public methods for the following properties:
1 The name method which returns the name of the flat file, excluding the base directories and the .csv extension.
2 The columns method which returns the columns stored in the header of the flat file split using commas (,).
3 The degree method which returns the size of the list of columns which is returned by the columns method.
4 The size method which returns the number of records (lines) in the flat file, excluding the header.
5 The equals method which returns true if the parameter is any table with the same fingerprint (as in previous modules).
6 Dont implement capacity or loadFactor, because this is a FileTable, not a DataTable.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!