Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
A static constant path for the base directories, which are db sub tables relative to the project directory.
A path for the flat file, which is the table file structure in CSV format.
No fields for the degree, size, fingerprint, or any other fields unlike in previous modules
C A ary constructor which takes a name parameter string and a columns parameter list of strings
Create the base directories, if needed.
Initialize the path field by resolving the given name plus the csv extension relative to the base directories.
If the flat file doesnt exist at the path field, create it
Join the columns parameter into a header record line using commas Dont use quotation marks.
Create a list of records list of lines with the header as its only record.
Write the list of records to the flat file.
D A ary constructor which takes a name parameter string only.
Initialize the path field by resolving the given name plus the csv extension relative to the base directories.
If the flat file doesnt exist at the path field, throw an illegal argument exception.
E A public clear method.
Read all records lines from the flat file into a list of records.
Clear all records from the list of records, retaining only the header.
Write the modified list of records to the flat file.
F Public methods for the following properties:
The name method which returns the name of the flat file, excluding the base directories and the csv extension.
The columns method which returns the columns stored in the header of the flat file split using commas
The degree method which returns the size of the list of columns which is returned by the columns method.
The size method which returns the number of records lines in the flat file, excluding the header.
The equals method which returns true if the parameter is any table with the same fingerprint as in previous modules
Dont implement capacity or loadFactor, because this is a FileTable, not a DataTable.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started