package cgeo.geocaching.sorting; import cgeo.geocaching.models.Geocache; /** * sorts caches by difficulty * */ class DifficultyComparator extends AbstractCacheComparator { @Override protected boolean canCompare(final Geocache cache) { return cache.getDifficulty() != 0.0; } @Override protected int compareCaches(final Geocache cache1, final Geocache cache2) { return Float.compare(cache1.getDifficulty(), cache2.getDifficulty()); } }