compareTo method

int compareTo(
  1. TimeSpan o
)
override

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Comparison is based on the number of milliseconds in this TimeSpan.

@param o the Object to be compared. @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Implementation

int compareTo(TimeSpan o) {
  TimeSpan compare = o;
  if (this.time == compare.time) {
    return 0;
  }
  if (this.time > compare.time) {
    return 1;
  }
  return -1;
}