//DateComparatorJulian.java //continuing the example from DateComparator.java //example of another meaning of comparison. import java.util.*; //***this comparator compares Dates by julian day within the year. //i.e. year is ignored. public class DateComparatorJulian implements Comparator { //must be this signature: //return 0 if equal, positive if a>b, negative if a d2.getMonth()) return 1; else if (d1.getMonth() < d2.getMonth()) return -1; else if (d1.getDay() > d2.getDay()) return 1; else if (d1.getDay() < d2.getDay()) return -1; else return 0; } }