ComparatorDemo
CSSE 221 – Fundamentals of Software Development Honors
Fall 2008–2009
This is an individual exercise. However, don't hesitate to
ask questions of your instructor, student assistants and classmates as desired.
Goals
The goals of this exercise are to apply and hence reinforce your understanding of the use of:
- Comparator classes as function objects
- Nested classes, especially anonymous classes
Overview
You will checkout a project that has a list of Employees,
and you will sort that list by using
various Comparator classes with the
sort method of the Collections class.
You will sort Employee objects by using:
- their natural ordering
- several other sort orders, with Comparator objects through:
- a separate top-level class
- a static nested class
- a local class inside a method
- an anonymous class
Instructions
- Checkout your ComparatorDemo project
from your individual respository.
- Note that ComparatorDemo has several stubbed methods,
each marked TODO.
Implement those methods, testing each as you complete it,
in the order that they appear (top to bottom).
- There is no report associated with this exercise.
- When you are done, commit your ComparatorDemo project to turn it in.
- Make sure that it obeys our code conventions -- use Source ~ Format if needed.
- Make sure that you documented your work appropriately.