equalsObj method
Tests whether this geometry is structurally and numerically equal
to a given Object
.
If the argument Object
is not a Geometry
,
the result is false
.
Otherwise, the result is computed using
{@link #equalsExact(Geometry)}.
This method is provided to fulfill the Java contract
for value-based object equality.
In conjunction with {@link #hashCode()}
it provides semantics which are most useful
for using
Geometry
s as keys and values in Java collections.
Note that to produce the expected result the input geometries should be in normal form. It is the caller's responsibility to perform this where required (using {@link Geometry#norm()} or {@link #normalize()} as appropriate).
@param o the Object to compare @return true if this geometry is exactly equal to the argument
@see #equalsExact(Geometry) @see #hashCode() @see #norm() @see #normalize()
Implementation
bool equalsObj(Object o) {
if (!(o is Geometry)) return false;
Geometry g = o as Geometry;
return equalsExactGeom(g);
}