CSCI 221
HOMEWORK ASSIGNMENT #3
Assigned Date: Monday, October 25, 2004
Unit Tests and Javadoc Due: Monday, November 1, 2004
Email to announce teams:
Tuesday, November 02, 2004, 5 PM
Complete Project Due: Tuesday, November 9, 2004
Due Time: Noon

Updated:   Tuesday, November 02, 2004, 13:15 PM
Thursday, November 04, 2004, 13:00 PM

 

Purpose:

This assignment focuses on linked data structures and more unit testing. 

 

Documentation:

See previous assignment.

 

Assignment: 

Develop a sorted linked-list ADT, called LinkedList.  This ADT should implement Dale’s ListInterface, with the following modifications:

  1. The ADT is robust (not “by contract”).
  2. Add a getPreviousItem() method to the interface file.
  3. Change all occurrences of Listable to Comparable.
    (Rationale: This will save you time because the Comparable Java interface provides a compareTo() method.  Also all Object’s have a clone() method which behaves like Dale’s copy().  There are several Java ADTs that implement Comparable, including Integer, Double and String; you will be able to use any one of these in conjunction with your LinkedList ADT.)

 

 

Implementation:

  1. Beware of memory leaks (e.g., when deleting items, set all pointers to null, so that the garbage collector may deallocate all deleted nodes).
  2. Use Java’s assert statement to test the preconditions of each method, for defensive programming.
  3. Submit updated javadoc documentation for all your class files (simply generate Javadoc APIs for each class in BlueJ).
  4. Apply the 7+|- 2 rule in each module you define.  Further modularize where appropriate.

 

Submission: 

You should submit your source file on a floppy disk, as per syllabus instructions. 

Source filenames to be submitted: 

A zip archive named <firstName_lastName_fourLastDigitsOfSSN>.hmwk3.zip (for example, Bill_Manaris_2308.hmwk3.zip).  This archive should contain the following files:

·        LinkedList (the BlueJ project directory).  Within LinkedList there should be the following files:

o       Readme.txt (see Widget for a sample)

o       Any files generated automatically by BlueJ (e.g., bluej.pkg, bluej.pkh, etc.)

o       LinkedList.java, LinkedListTest.java, ListInterface.java.

o       A doc subdirectory with the Javadoc API documentation generated by BlueJ, for ListInterface and LinkedListTest.

Note: If you are working with a partner, the name of the zip archive should contain the names of both partners as follows: <firstName_lastName_fourLastDigitsOfSSN_AND_ firstName_lastName_fourLastDigitsOfSSN>.hmwk3.zip.  Ensure that the documentation is updated appropriately, including the Certificate of Authenticity.