import java.util.Comparator; /* An instance of this class defines an ordering on states in the USA ** (as represented by objects of the StateInUSA class) according to ** their areas (as measured by square miles or kilometers, for example). ** Among two states, the one with the larger area is defined to be less ** than one with the smaller area. (Thus, if a collection of states is ** listed in ascending order according to this Comparator, they will be ** listed from largest to smallest areas.) ** ** Authors: R. McCloskey and */ public class CompareByArea implements Comparator { /* According to whether the area of stateA is greater than, equal to, ** or less than, respectively, that of stateB, returns either a ** negative number, zero, or a positive number, respectively. */ public int compare(StateInUSA stateA, StateInUSA stateB) { return 0; // STUB } }