本文整理汇总了Java中com.ibm.icu.lang.UScript.getName方法的典型用法代码示例。如果您正苦于以下问题:Java UScript.getName方法的具体用法?Java UScript.getName怎么用?Java UScript.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.icu.lang.UScript
的用法示例。
在下文中一共展示了UScript.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Spec
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
public Spec(String theSpec) {
top = theSpec;
spec = null;
scriptName = null;
try{
// Canonicalize script name. If top is a script name then
// script != UScript.INVALID_CODE.
int script = UScript.getCodeFromName(top);
// Canonicalize script name -or- do locale->script mapping
int[] s = UScript.getCode(top);
if (s != null) {
scriptName = UScript.getName(s[0]);
// If the script name is the same as top then it's redundant
if (scriptName.equalsIgnoreCase(top)) {
scriptName = null;
}
}
isSpecLocale = false;
res = null;
// If 'top' is not a script name, try a locale lookup
if (script == UScript.INVALID_CODE) {
Locale toploc = LocaleUtility.getLocaleFromName(top);
res = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_TRANSLIT_BASE_NAME,toploc);
// Make sure we got the bundle we wanted; otherwise, don't use it
if (res!=null && LocaleUtility.isFallbackOf(res.getULocale().toString(), top)) {
isSpecLocale = true;
}
}
}catch(MissingResourceException e){
///CLOVER:OFF
// The constructor is called from multiple private methods
// that protects an invalid scriptName
scriptName = null;
///CLOVER:ON
}
// assert(spec != top);
reset();
}
示例2: getName
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
@Override
public String getName() {
return UScript.getName(code);
}
示例3: getName
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
@Override
public String getName() {
return UScript.getName(code);
}