public void setAndToggle(final SortType type) {
        if (this.type.equals(type)) {
            isInverse = !isInverse;
        } else {
            this.type = type;
            isInverse = false;
        }
    }
Sets a new sorttype. If already selected type is set, then the search order is inversed
main/src/main/java/cgeo/geocaching/sorting/GeocacheSort.java