@Test public void compareToTest() { GeoPoint geoPoint1 = new GeoPoint(LATITUDE, LONGITUDE); GeoPoint geoPoint2 = new GeoPoint(LATITUDE, LONGITUDE); GeoPoint geoPoint3 = new GeoPoint(0, 0); Assert.assertEquals(0, geoPoint1.compareTo(geoPoint2)); Assert.assertFalse(geoPoint1.compareTo(geoPoint3) == 0); }
@Override public int compareTo(GeoPoint geoPoint) { if (this.longitudeE6 > geoPoint.longitudeE6) { return 1; } else if (this.longitudeE6 < geoPoint.longitudeE6) { return -1; } else if (this.latitudeE6 > geoPoint.latitudeE6) { return 1; } else if (this.latitudeE6 < geoPoint.latitudeE6) { return -1; } return 0; }
GeoPoint implements Comparable<GeoPoint>, Serializable { @Override public int compareTo(GeoPoint geoPoint) { if (this.longitudeE6 > geoPoint.longitudeE6) { return 1; } else if (this.longitudeE6 < geoPoint.longitudeE6) { return -1; } else if (this.latitudeE6 > geoPoint.latitudeE6) { return 1; } else if (this.latitudeE6 < geoPoint.latitudeE6) { return -1; } return 0; } }
GeoPoint implements Comparable<GeoPoint>, Serializable { @Override public int compareTo(GeoPoint geoPoint) { if (this.longitudeE6 > geoPoint.longitudeE6) { return 1; } else if (this.longitudeE6 < geoPoint.longitudeE6) { return -1; } else if (this.latitudeE6 > geoPoint.latitudeE6) { return 1; } else if (this.latitudeE6 < geoPoint.latitudeE6) { return -1; } return 0; } GeoPoint(double latitude, double longitude);  GeoPoint(int latitudeE6, int longitudeE6); }
GeoPoint implements Comparable<GeoPoint>, Serializable { @Override public int compareTo(GeoPoint geoPoint) { if (this.longitudeE6 > geoPoint.longitudeE6) { return 1; } else if (this.longitudeE6 < geoPoint.longitudeE6) { return -1; } else if (this.latitudeE6 > geoPoint.latitudeE6) { return 1; } else if (this.latitudeE6 < geoPoint.latitudeE6) { return -1; } return 0; } GeoPoint(double latitude, double longitude);  GeoPoint(int latitudeE6, int longitudeE6); @Override int compareTo(GeoPoint geoPoint); @Override boolean equals(Object obj); double getLatitude(); double getLongitude(); @Override int hashCode(); @Override String toString(); }
GeoPoint implements Comparable<GeoPoint>, Serializable { @Override public int compareTo(GeoPoint geoPoint) { if (this.longitudeE6 > geoPoint.longitudeE6) { return 1; } else if (this.longitudeE6 < geoPoint.longitudeE6) { return -1; } else if (this.latitudeE6 > geoPoint.latitudeE6) { return 1; } else if (this.latitudeE6 < geoPoint.latitudeE6) { return -1; } return 0; } GeoPoint(double latitude, double longitude);  GeoPoint(int latitudeE6, int longitudeE6); @Override int compareTo(GeoPoint geoPoint); @Override boolean equals(Object obj); double getLatitude(); double getLongitude(); @Override int hashCode(); @Override String toString(); final int latitudeE6; final int longitudeE6; }