CMPS 144L
Lab Activity: Generic Sorting

Provided are the following Java classes:

The student's task is to develop two concrete child classes of the generic Sorter class, namely CalendarDateSorter and TimeOfDaySorter.

As their names suggest, an instance of the former is to be capable of sorting an array of CalendarDate objects and an instance of the latter is to be capable of sorting an array of TimeOfDay objects. Each one inherits the sort() methods of its parent; all that needs to be explicitly included is a (concrete) isLessThan() method.

The isLessThan() method of CalendarDateSorter should define the most obvious ordering, namely that in which a date earlier in history is deemed to be less than a date later in history. For example, March 25, 1967 is less than January 5, 2022.

The isLessThan() method of TimeOfDaySorter should define the most obvious ordering, namely that in which a time earlier in the day is deemed to be less than a time later in the day. For example, 10:43AM is less than 3:15PM.