private static boolean isOneLabelBetterThanOther ( Normalizer2 nfkdNormalizer , String one , String other ) { // This is called with primary-equal strings, but never with one.equals(other). String n1 = nfkdNormalizer . normalize ( one ) ; String n2 = nfkdNormalizer . normalize ( other ) ; int result = n1 . codePointCount ( 0 , n1 . length ( ) ) - n2 . codePointCount ( 0 , n2 . length ( ) ) ; if ( result != 0 ) { return result < 0 ; } result = binaryCmp . compare ( n1 , n2 ) ; if ( result != 0 ) { return result < 0 ; } return binaryCmp . compare ( one , other ) < 0 ; }
Returns true if one index character string is better than the other . Shorter NFKD is better and otherwise NFKD - binary - less - than is better and otherwise binary - less - than is better .