diff options
| author | SammysHP <sven@sammyshp.de> | 2011-09-14 21:42:32 +0200 |
|---|---|---|
| committer | SammysHP <sven@sammyshp.de> | 2011-09-14 21:42:32 +0200 |
| commit | 4f7c67407019de18fd53b640edb9682a346fbfef (patch) | |
| tree | 5a1d10843e8f5104e4202211f4792b5bfe830cb6 /src/cgeo/geocaching/sorting/GeocodeComparator.java | |
| parent | 90e7bf968f6722b8df8b884f37617e7fc78901b5 (diff) | |
| download | cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.zip cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.tar.gz cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.tar.bz2 | |
Formatting
Diffstat (limited to 'src/cgeo/geocaching/sorting/GeocodeComparator.java')
| -rw-r--r-- | src/cgeo/geocaching/sorting/GeocodeComparator.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/cgeo/geocaching/sorting/GeocodeComparator.java b/src/cgeo/geocaching/sorting/GeocodeComparator.java index 957545b..004970b 100644 --- a/src/cgeo/geocaching/sorting/GeocodeComparator.java +++ b/src/cgeo/geocaching/sorting/GeocodeComparator.java @@ -1,28 +1,28 @@ package cgeo.geocaching.sorting; -import org.apache.commons.lang3.StringUtils; - 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 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); - } + @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); + } } |
