Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. QUESTION 1
  2. Grade: 0.95
  3. File: BasicWorksheetModel, Line: 72
  4. The only problem that we had with our previous model design was dealing with multiple recursive cell formulas. Previously, when we created a cell, we would add the cell to the hashtable without trying to evaluate it, which caused a runtime error. Now, we try to evaluate the cell's formula before putting it in the hashtable to avoid runtime errors and it works perfectly.
  5.  
  6. QUESTION 2
  7. Textual view:
  8. This was fairly simple; we used the toString method to evaluate the text input and return a textual evaluated version of the spreadsheet.
  9.  
  10. Graphics view:
  11. We used the JTable for our GUI implementation, so we had to use a wrapper class to make our spreadsheet's data model compatible with JTable. The other problem we had to tackle was creating row headers. We have a class that gets the data required to be displayed for row headers (i.e. 1, 2, 3) and another class that actually renders the header as a JLabel.
  12.  
  13. Most of this is described in the README file. If any details are unclear, please reach out to us.
  14.  
  15. QUESTION 3
  16. Properties:
  17. The hashtable variable is simply our data model, which includes a Coord key and Cell value.
  18. ValueTable is intended to be the evaluated version of the hashtable; we thought we would create this to avoid recursion, but we later found out a better way of handling recursion (as previously described).
  19. OrderedCoords was also initially intended to avoid recursion; once we found a better way of handling recursion, we decided just to keep it because it does not make a difference in our program's functionality.
  20.  
  21. Our model mainly relies on the hashtable as the data model. (need to continue).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement