From 39ec7accd759fd60706523b366977ba371efd168 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 8 Sep 2011 00:00:58 +0200 Subject: Refactoring to use Geopoint for coordinates This uses the new Geopoint immutable class discussed in #58. No more independent longitude or latitude fields -- they are now treated and defined as a consistent pair. --- src/cgeo/geocaching/cgCache.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/cgeo/geocaching/cgCache.java') diff --git a/src/cgeo/geocaching/cgCache.java b/src/cgeo/geocaching/cgCache.java index dfa5029..56505e6 100644 --- a/src/cgeo/geocaching/cgCache.java +++ b/src/cgeo/geocaching/cgCache.java @@ -20,6 +20,7 @@ import android.util.Log; import cgeo.geocaching.activity.IAbstractActivity; import cgeo.geocaching.connector.ConnectorFactory; import cgeo.geocaching.connector.IConnector; +import cgeo.geocaching.geopoint.Geopoint; /** * Internal c:geo representation of a "cache" @@ -53,8 +54,7 @@ public class cgCache implements ICache { public String latitudeString = ""; public String longitudeString = ""; public String location = ""; - public Double latitude = null; - public Double longitude = null; + public Geopoint coords = null; public boolean reliableLatLon = false; public Double elevation = null; public String personalNote = null; @@ -183,11 +183,8 @@ public class cgCache implements ICache { if (StringUtils.isBlank(location)) { location = oldCache.location; } - if (latitude == null) { - latitude = oldCache.latitude; - } - if (longitude == null) { - longitude = oldCache.longitude; + if (coords == null) { + coords = oldCache.coords; } if (elevation == null) { elevation = oldCache.elevation; -- cgit v1.1