compareTo method

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

Returns sort order as negative, 0, or positive.

Implementation

@override
int compareTo(Object that) {
  final thatVal = (that as HNum).val;
  if (val < thatVal) return -1;
  if (val == thatVal) return 0;
  return 1;
}