Objective: To get experience using collections
Due: Before class on Wednesday
Modify your MediaItem
class such that it implements the
Comparable
interface with the parameterized class type,
in this case MediaItem. Eclipse will guide you with how to fix the
warning.
Also, fix any issues mentioned in feedback on previous assignments.
Notes
compareTo
methods.
We discussed several different types of collections: lists, sets, and maps. In your driver program for the MediaItems, instead of an array, use an appropriate collection to store your items. Before making your choice, consider how easily you can implement the same functionality as in the last assignment, e.g., easily you can store items, retrieve items, and sort items.
This part is underspecified on purpose. You may want to look at the user interaction requirements below before making a decision. In comments in your driver program, defend your choice of collection.
We've now dealt with handling user input. Modify your driver program so that it provides a menu for the user to manipulate the library. Allow the user to
Here is some code to help you get started.
If I have been giving you feedback about poor variable names, poor method naming, poor coding practices, poor formatting, inefficient code, not encapsulating, etc., clean up your code before submitting. Use Eclipse's refactoring and formatting tools and note any warnings too and see if you can clean up your code a bit.
Save output from one run of your UserInterface in a file.
Copy your code into an assign8
directory in your turnin
directory.
You will be evaluated based on the following criteria: