File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
src/main/java/datawave/data/type/util Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11package datawave .data .type .util ;
22
33import java .io .Serializable ;
4+ import java .util .Objects ;
45
56/**
67 * The base GeoWave geometry delegate object, which wraps the underlying JTS geometry
@@ -19,7 +20,22 @@ public T getJTSGeometry() {
1920 return jtsGeom ;
2021 }
2122
23+ @ Override
2224 public String toString () {
2325 return jtsGeom .toText ();
2426 }
27+
28+ @ Override
29+ public int hashCode () {
30+ return Objects .hashCode (jtsGeom );
31+ }
32+
33+ @ Override
34+ public boolean equals (Object o ) {
35+ if (o instanceof Geometry ) {
36+ Geometry other = (Geometry ) o ;
37+ return Objects .equals (jtsGeom , other .jtsGeom );
38+ }
39+ return false ;
40+ }
2541}
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ public Geometry(org.locationtech.jts.geom.Geometry jtsGeom) {
1212
1313 @ Override
1414 public int compareTo (Geometry o ) {
15- return jtsGeom .compareTo (o .jtsGeom );
15+ if (jtsGeom == o .jtsGeom ) {
16+ return 0 ;
17+ } else if (jtsGeom == null ) {
18+ return -1 ;
19+ } else if (o .jtsGeom == null ) {
20+ return 1 ;
21+ } else {
22+ return jtsGeom .compareTo (o .jtsGeom );
23+ }
1624 }
1725}
You can’t perform that action at this time.
0 commit comments