Search in sources :

Example 46 with CollationKey

use of android.icu.text.CollationKey in project j2objc by google.

the class CollationGermanTest method doTest.

// main test routine, tests rules specific to germa locale
private void doTest(char[] source, char[] target, int result) {
    String s = new String(source);
    String t = new String(target);
    int compareResult = myCollation.compare(s, t);
    CollationKey sortKey1, sortKey2;
    sortKey1 = myCollation.getCollationKey(s);
    sortKey2 = myCollation.getCollationKey(t);
    int keyResult = sortKey1.compareTo(sortKey2);
    reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
}
Also used : CollationKey(android.icu.text.CollationKey)

Example 47 with CollationKey

use of android.icu.text.CollationKey in project j2objc by google.

the class CollationKanaTest method doTest.

// main test routine, tests rules specific to "Kana" locale
private void doTest(char[] source, char[] target, int result) {
    String s = new String(source);
    String t = new String(target);
    int compareResult = myCollation.compare(s, t);
    CollationKey sortKey1, sortKey2;
    sortKey1 = myCollation.getCollationKey(s);
    sortKey2 = myCollation.getCollationKey(t);
    int keyResult = sortKey1.compareTo(sortKey2);
    reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
}
Also used : CollationKey(android.icu.text.CollationKey)

Aggregations

CollationKey (android.icu.text.CollationKey)47 RuleBasedCollator (android.icu.text.RuleBasedCollator)28 Test (org.junit.Test)27 RawCollationKey (android.icu.text.RawCollationKey)19 Collator (android.icu.text.Collator)15 Locale (java.util.Locale)8 ULocale (android.icu.util.ULocale)7 UnicodeSet (android.icu.text.UnicodeSet)3 ParseException (java.text.ParseException)3 Random (java.util.Random)3 CollationElementIterator (android.icu.text.CollationElementIterator)2 UnicodeSetIterator (android.icu.text.UnicodeSetIterator)2 MissingResourceException (java.util.MissingResourceException)2 Output (android.icu.util.Output)1 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1