Methods Summary |
---|
public static native int | getCollationLocaleIndex(java.lang.String locale)Get index of supported locales for string collation by its name.
|
public static native java.lang.String | getCollationLocaleName(int index)Get one of supported locales (by number).
|
public static native int | getCollationLocalesCount()Get number of supported locales for string collation.
|
public CommonStringComparator | getStringComparator(java.lang.String locale, int level)Returns an instance of the {@link StringComparatorImpl} class,
which realizes all StringComparator methods in a
platform-specific way.
return new StringComparatorImpl(locale, level);
|
public java.lang.String[] | getSupportedLocales()Gets the locales for which a StringComparator is available
in this implementation. If no locales are supported, the returned array
must be empty, not null . As the value null is
not technically a valid locale, but a special value to trigger the
generic collation algorithm, it must not appear in the array.
int lcount = getCollationLocalesCount();
if (lcount == 0) return new String[0];
int index = 0;
String locale = getCollationLocaleName(0);
if (locale == null || locale.equals("")){
index = 1;
}
String[] locales = new String[lcount-index];
for (int i=0; index < lcount; index++) {
locales[i++] = getCollationLocaleName(index);
}
return locales;
|