compareTo method

  1. @override
int compareTo(
  1. Object that
)
override

Returns sort order as negative, 0, or positive

Implementation

@override
int compareTo(Object that) {
  HDate x = that as HDate;
  if (year < x.year) {
    return -1;
  } else if (year > x.year) return 1;

  if (month < x.month) {
    return -1;
  } else if (month > x.month) return 1;

  if (day < x.day) {
    return -1;
  } else if (day > x.day) return 1;

  return 0;
}