10 date 2008.04.16.00.54.22; author rmh3093; state Exp;
35 import java.util.Comparator;
38 * This class provides a comparator so that teams can be arranged on the
39 * alternate basis of 'strength of schedule'.
43 public class TeamComparator implements Comparator<Team> {
46 * compare needed in order to satisfy the interface definition
48 * @@param first first of two teams
49 * @@param second second of two teams
50 * @@return compares two teams, but only on the basis of their strength of
51 * schedules; returns -1 if the 'first' team has a schedule considered
52 * stronger than the 'second' team; returns 1 if the 'second' team has a
53 * schedule considered stronger than the 'first' team; otherwise, returns 0.
55 public int compare(Team first, Team second) {
56 if (first.getStrengthOfSchedule() >
57 second.getStrengthOfSchedule()) {
59 } else if (first.getStrengthOfSchedule() <
60 second.getStrengthOfSchedule()) {