aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Geocache.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-12-19 14:29:46 +0100
committerBananeweizen <bananeweizen@gmx.de>2013-12-19 14:29:46 +0100
commit82661d89ea3159000ae42fbbc0d45d663776dbee (patch)
tree4c69c7096ffc3fce8df7eb57b1bc260cc88c664d /main/src/cgeo/geocaching/Geocache.java
parentab95288249526d59a7e1949e3c9a8dd4877dde54 (diff)
downloadcgeo-82661d89ea3159000ae42fbbc0d45d663776dbee.zip
cgeo-82661d89ea3159000ae42fbbc0d45d663776dbee.tar.gz
cgeo-82661d89ea3159000ae42fbbc0d45d663776dbee.tar.bz2
refactoring: remove duplicate code
Diffstat (limited to 'main/src/cgeo/geocaching/Geocache.java')
-rw-r--r--main/src/cgeo/geocaching/Geocache.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java
index bded7d0..241f180 100644
--- a/main/src/cgeo/geocaching/Geocache.java
+++ b/main/src/cgeo/geocaching/Geocache.java
@@ -1813,4 +1813,21 @@ public class Geocache implements ICache, IWaypoint {
public String getWaypointPrefix(String name) {
return getConnector().getWaypointPrefix(name);
}
+
+ /**
+ * Get number of overall finds for a cache, or 0 if the number of finds is not known.
+ *
+ * @return
+ */
+ public int getFindsCount() {
+ if (getLogCounts().isEmpty()) {
+ setLogCounts(DataStore.loadLogCounts(getGeocode()));
+ }
+ Integer logged = getLogCounts().get(LogType.FOUND_IT);
+ if (logged != null) {
+ return logged;
+ }
+ return 0;
+ }
+
}