blob: 10500f98e20d27d0f6e89e2686608bb3e84cfacc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package cgeo.geocaching;
import java.util.Comparator;
import android.util.Log;
public class cgCachePopularityComparator implements Comparator<cgCache> {
public int compare(cgCache cache1, cgCache cache2) {
try {
if (cache1.favouriteCnt == null || cache2.favouriteCnt == null) {
return 0;
}
if (cache1.favouriteCnt < cache2.favouriteCnt) {
return 1;
} else if (cache2.favouriteCnt < cache1.favouriteCnt) {
return -1;
} else {
return 0;
}
} catch (Exception e) {
Log.e(cgSettings.tag, "cgCachePopularityComparator.compare: " + e.toString());
}
return 0;
}
}
|