equals method

bool equals(
  1. Object o
)

Returns true if other has the same values for its points.

@param o a LineSegment with which to do the comparison. @return true if other is a LineSegment with the same values for the x and y ordinates.

Implementation

bool equals(Object o) {
  if (!(o is LineSegment)) {
    return false;
  }
  LineSegment other = o as LineSegment;
  return p0.equals(other.p0) && p1.equals(other.p1);
}