package cgeo.geocaching.sorting; import cgeo.geocaching.Geocache; public class FindsComparator extends AbstractCacheComparator { @Override protected boolean canCompare(Geocache cache1, Geocache cache2) { return cache1.getLogCounts() != null && cache2.getLogCounts() != null; } @Override protected int compareCaches(Geocache cache1, Geocache cache2) { int finds1 = getFindsCount(cache1); int finds2 = getFindsCount(cache2); return finds2 - finds1; } }