compareToSameClassWithComparator method

int compareToSameClassWithComparator(
  1. Object other,
  2. Comparator<CoordinateSequence> comp
)
override

Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given {@link CoordinateSequenceComparator}.

@param o a Geometry having the same class as this Geometry @param comp a CoordinateSequenceComparator @return a positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications

Implementation

int compareToSameClassWithComparator(
    Object other, Comparator<CoordinateSequence> comp) {
  Point point = other as Point;
  return comp(this.coordinates!, point.coordinates!);
}