aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/sorting/GeocodeComparator.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-09-16 14:36:28 +0200
committerSamuel Tardieu <sam@rfc1149.net>2011-09-16 14:36:28 +0200
commit579ef7a535489d4aa632db11667a3b01deb6cafd (patch)
tree55810021c02ac7d80d3a9702ef0b59e4af154b9c /src/cgeo/geocaching/sorting/GeocodeComparator.java
parent96ea21fd50334479c262da692038965d0e4d596a (diff)
downloadcgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.zip
cgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.tar.gz
cgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.tar.bz2
Move sources into the main directory
This prepares the inclusion of tests into the same repository.
Diffstat (limited to 'src/cgeo/geocaching/sorting/GeocodeComparator.java')
-rw-r--r--src/cgeo/geocaching/sorting/GeocodeComparator.java28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/cgeo/geocaching/sorting/GeocodeComparator.java b/src/cgeo/geocaching/sorting/GeocodeComparator.java
deleted file mode 100644
index 136d7f5..0000000
--- a/src/cgeo/geocaching/sorting/GeocodeComparator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cgeo.geocaching.sorting;
-
-import cgeo.geocaching.cgCache;
-
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * sorts caches by GC code, therefore effectively sorting by cache age
- *
- */
-public class GeocodeComparator extends AbstractCacheComparator {
-
- @Override
- protected boolean canCompare(cgCache cache1, cgCache cache2) {
- return StringUtils.isNotBlank(cache1.geocode)
- && StringUtils.isNotBlank(cache2.geocode);
- }
-
- @Override
- protected int compareCaches(cgCache cache1, cgCache cache2) {
- if (cache1.geocode.length() > cache2.geocode.length()) {
- return 1;
- } else if (cache2.geocode.length() > cache1.geocode.length()) {
- return -1;
- }
- return cache1.geocode.compareToIgnoreCase(cache2.geocode);
- }
-}