CS 1713 Laboratory 10:
The DepartmentStore - Object hierarchies and inheritance

Note: This is a two-week lab. In the second week you will learn how to use the Javadoc documentation generator to produce professional-looking documentation for your projects.

Objectives:

Hand-in Requirements (Deliverables):

All projects and laboratories will be submitted electronically through webCT. Zip up your entire project directory for submission. (Right click on the project folder and follow the SentTo link.) The project source directory should include the following classes:

Overview:

You will be using the class hierarchy for StaffMember shown in Figure 9.1 of the textbook to implement a DepartmentStore class that will track the employees of a particular store. The classes shown in Figure 9.3 (StaffMember), Figure 9.5 (Employee), Figure 9.6 (Executive), and Figure 9.7 (Hourly) are already written. Our department store doesn't use volunteers, so the Volunteer class of Figure 9.4 isn't included. A helper class EmployeeIO is also provided to create Employee objects of various types by reading data from a file. Part II explores the use of this class. Part III makes the Employee class implement Comparable. Part IV guides you through the development of a DepartmentStore class that uses Employee objects of various sorts. In Part V you will generate Javadoc documentation for the classes in the project.

Part I: Setup:

Part II: Using the EmployeeIO class.

Part III: Making Employee implement Comparable

Part IV: The DepartmentStore class

The DepartmentStore class keeps track of all the information about the employees for a particular store.
The DepartmentStore has a name and methods to add, remove, and find particular employees.
The DepartmentStore has the usual accessor and toString methods as well as various forms of printing as specified below.
Internally, use an ArrayList to hold the employees.

Part IV: Javadoc

Javadoc is Java's automatic documentation facility. It produces documentation similar to the documentation for Java itself. (See Appendix I of the textbook for more details on Javadoc.)

In this part of the lab you will generate the Javadoc documentation for the Employee class. Provide header documentation for the class and for each constructor. Also document all non-private attributes and methods. (There should not be any non-prive atributes for this class. To guide you, the EmployeeIO and the StaffMember classes have already been documented.)

Create a general comment for the class and for each public method. For each public method include @param and @return tags as appropriate.

Once you have inserted the appropriate comments in your code, you must generate the javadoc files from the source code. To do this in eclipse, go to Project -> Generate Javadoc ...
If the Javadoc command field is not filled in, click Condifure... and locate the javadoc.exe command. It is probably in a bin directory under C:\Program Files\Java. Look for a directory that starts with jdk.
In the left hand pane, select the directory containing your source code,
lab10 -> src -> departmentstorepkg
Under Create Javadoc for members with visibility select Public
and make sure Use Standard Docet is selected. The destination should end in lab10\doc.
Click Finish to build the files.
To see the results, point your browser to lab10\doc\index.html and select the Employee class under Class Summary.