aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/sorting/InverseComparator.java
blob: 1dc76e2fe71b3d77b60617a134ea7b839b7863b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cgeo.geocaching.sorting;

import cgeo.geocaching.Geocache;

/**
 * comparator which inverses the sort order of the given other comparator
 * 
 */
public class InverseComparator implements CacheComparator {

    private final CacheComparator originalComparator;

    public InverseComparator(CacheComparator comparator) {
        this.originalComparator = comparator;
    }

    @Override
    public int compare(Geocache lhs, Geocache rhs) {
        return originalComparator.compare(rhs, lhs);
    }

}