Checks if this segment is equal to another object.
true if the objects are equal, false otherwise.
The object to compare with.