@Override
    public int compareTo(CharsetMatch other) {
        int compareResult = 0;
        if (this.fConfidence > other.fConfidence) {
            compareResult = 1;
        } else if (this.fConfidence < other.fConfidence) {
            compareResult = -1;
        }
        return compareResult;
    }
Compare to other CharsetMatch objects.
Comparison is based on the match confidence value, which
allows CharsetDetector.detectAll() to order its results.

@param other the CharsetMatch object to compare against.
@return a negative integer, zero, or a positive integer as the
confidence level of this CharsetMatch
is less than, equal to, or greater than that of
the argument.
@throws ClassCastException if the argument is not a CharsetMatch.
@stable ICU 4.4
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/txt/CharsetMatch.java