private static int getState(final Geocache cache) {
        if (cache.isDisabled()) {
            return 1;
        }
        if (cache.isArchived()) {
            return 2;
        }
        return 0;
    }
sort caches by state (normal, disabled, archived)
main/src/main/java/cgeo/geocaching/sorting/StateComparator.java