compareTo method

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

Returns sort order as negative, 0, or positive.

Implementation

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

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

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

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

  return 0;
}