Answered step by step
Verified Expert Solution
Link Copied!

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:
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

LO6 List the components of job descriptions.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago