Reference no: EM132398868
Problem description
The assignment deals with a simplified version of spreadsheet storage. A worksheet, in it's most fundamental nature, stores numbers in rows and columns. Of course, spreasheets can store other kinds of values like names, addresses, etc but that is beyond the scope of this assignment.
You are provided the method read(String) in class WorksheetReader. Do not modify this method. It relies on the file containing input data being in the following format:
WorksheetName
<row><column><value>
<row><column><value>
<row><column><value>
...
A workbook is a collection of worksheets.
You are provided the method read(String) in class WorkbookReader. Do not modify this method. It relies on the file containing input data being in the following format:
WorkbookName
<empty line>
WorksheetName1
<row><column><value>
<row><column><value>
<row><column><value>
...
<empty line>
WorksheetName2
<row><column><value>
<row><column><value>
<row><column><value>
...
<empty line>
WorksheetNameN
<row><column><value>
<row><column><value>
<row><column><value>
...
DataEntry.java
Start with DataEntry.java. Complete the method inRange. Each DataEntry object has 3 attributes:
• row number (row): int
• column number (column): int
• contents (value): double
Note that row and column numbers begin with 0.
Worksheet.java
Move on to Worksheet.java. This is where you need to complete most of the methods. Read the javadoc comments and take a look at the tests to figure out what needs to be done.
A worksheet contains an ArrayList of DataEntry objects.
Hence, a worksheet with items:
• row=0, column=3, value=2.5
• row=1, column=2, value=-1.5
• row=2, column=1, value=4.5
• row=2, column=28, value=0.5
represents the following worksheet:
A(0) B(1) C(2) D(3) ... AC(28)
0 - - - 2.5 -
1 - - -1.5 - -
2 - 4.5 - - 0.5
Workbook.java
The third stage is Workbook.java. The only method we want you to complete in this class is copyPaste that copies a range of data from one worksheet and pastes it at a specified location (as given by row and column numbers) in another spreadsheet.