]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - src/tim/prune/function/srtm/SrtmTile.java
wip viewfinder
[GpsPrune.git] / src / tim / prune / function / srtm / SrtmTile.java
index 7bc1d386419732c8d7ab9b048bcf06407d06a36b..69e8537b7fc39d4631fa682de5de996aa08ad110 100644 (file)
@@ -41,9 +41,20 @@ public class SrtmTile
         * @param inOther other tile object
         * @return true if both represent same tile
         */
-       public boolean equals(SrtmTile inOther)
+       public boolean equals(Object inOther)
        {
-               return (_latitude == inOther._latitude) && (_longitude == inOther._longitude);
+               if (! (inOther instanceof SrtmTile))
+               {
+                       return false;
+               }
+               SrtmTile otherTile = (SrtmTile) inOther;
+               return (_latitude == otherTile._latitude) &&
+                       (_longitude == otherTile._longitude);
+       }
+
+       public int hashCode()
+       {
+               return 360 * _latitude + _longitude;
        }
 
        /** @return latitude as int */