Ejemplo n.º 1
0
 /** Compares two dates and returns -1, 0, or 1 is the date is before, equal or after */
 public int compareTo(Date other) {
   if (this.getYear() < other.getYear()) return -1;
   else if ((this.getYear() <= other.getYear()) && (this.getIntMonth() < other.getIntMonth()))
     return -1;
   else if ((this.getYear() <= other.getYear())
       && (this.getIntMonth() <= other.getIntMonth())
       && (this.getDay() < other.getDay())) return -1;
   else if ((this.getYear() == other.getYear())
       && (this.getIntMonth() == other.getIntMonth())
       && (this.getDay() == other.getDay())) return 0;
   else return 1;
 }