compareTo method
Compares this object with the specified object for order. Uses the standard lexicographic ordering for the points in the LineSegment.
@param o the LineSegment
with which this LineSegment
is being compared
@return a negative integer, zero, or a positive integer as this LineSegment
is less than, equal to, or greater than the specified LineSegment
Implementation
int compareTo(dynamic o) {
LineSegment other = o as LineSegment;
int comp0 = p0.compareTo(other.p0);
if (comp0 != 0) return comp0;
return p1.compareTo(other.p1);
}