aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgCache.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-09-08 00:00:58 +0200
committerSamuel Tardieu <sam@rfc1149.net>2011-09-08 11:32:14 +0200
commit39ec7accd759fd60706523b366977ba371efd168 (patch)
tree401ba08d9ec58e49d02ce614e12db5cf7b2b57bd /src/cgeo/geocaching/cgCache.java
parent668472ec735f827a4741a971614596df02618689 (diff)
downloadcgeo-39ec7accd759fd60706523b366977ba371efd168.zip
cgeo-39ec7accd759fd60706523b366977ba371efd168.tar.gz
cgeo-39ec7accd759fd60706523b366977ba371efd168.tar.bz2
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.
Diffstat (limited to 'src/cgeo/geocaching/cgCache.java')
-rw-r--r--src/cgeo/geocaching/cgCache.java11
1 files changed, 4 insertions, 7 deletions
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;