import java.util.Comparator; /* An instance of this class defines an ordering on states of the USA ** (as represented by objects of the StateInUSA class) according to their ** numbers of electoral votes, with ties broken by their names. ** Among two states, the one with the larger number of electoral votes is ** defined to be less than the one with fewer electoral votes. Among two ** states having the same number of electoral votes, the one whose name ** precedes the other alphabetically is defined to be the lesser of the ** two. ** ** Authors: R. McCloskey and */ public class CompareByElectVotesAndName implements Comparator { /* If the number of electoral votes of stateA is greater (respectively, ** less) than that of stateB, a negative (respectively, positive) number ** is returned. If they have the same number of electoral votes, the ** number returned is negative, zero, or positive according to how their ** names compare using String's compareTo() method (which is consistent ** with lexicographic order). */ public int compare(StateInUSA stateA, StateInUSA stateB) { return 0; // STUB } }