当前位置: 首页>>代码示例>>Java>>正文


Java Collator.getAvailableLocales方法代码示例

本文整理汇总了Java中java.text.Collator.getAvailableLocales方法的典型用法代码示例。如果您正苦于以下问题:Java Collator.getAvailableLocales方法的具体用法?Java Collator.getAvailableLocales怎么用?Java Collator.getAvailableLocales使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.text.Collator的用法示例。


在下文中一共展示了Collator.getAvailableLocales方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInstance

import java.text.Collator; //导入方法依赖的package包/类
public static HanziToPinyin getInstance() {
    synchronized (HanziToPinyin.class) {
        if (sInstance != null) {
            return sInstance;
        }
        // Check if zh_CN collation data is available
        final Locale locale[] = Collator.getAvailableLocales();
        for (int i = 0; i < locale.length; i++) {
            if (locale[i].equals(Locale.CHINA)) {
                // Do self validation just once.
                if (DEBUG) {

                    android.util.Log.d(TAG, "Self validation. Result: " +
                            doSelfValidation());
                }
                sInstance = new HanziToPinyin(true);
                return sInstance;
            }
        }
        android.util.Log.w(TAG,
                "There is no Chinese collator, HanziToPinyin is disabled");
        sInstance = new HanziToPinyin(false);
        return sInstance;
    }
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:26,代码来源:HanziToPinyin.java

示例2: getInstance

import java.text.Collator; //导入方法依赖的package包/类
public static HanziToPinyin getInstance() {
    synchronized (HanziToPinyin.class) {
        if (sInstance != null) {
            return sInstance;
        }
        // Check if zh_CN collation data is available
        final Locale locale[] = Collator.getAvailableLocales();
        for (int i = 0; i < locale.length; i++) {
            if (locale[i].equals(Locale.CHINESE)) {
                // Do self validation just once.
                if (DEBUG) {
                    Log.d(TAG, "Self validation. Result: " + doSelfValidation());
                }
                sInstance = new HanziToPinyin(true);
                return sInstance;
            }
        }
        Log.w(TAG, "There is no Chinese collator, HanziToPinyin is disabled");
        sInstance = new HanziToPinyin(false);
        return sInstance;
    }
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:23,代码来源:HanziToPinyin.java

示例3: getInstance

import java.text.Collator; //导入方法依赖的package包/类
public static HanziToPinyin3 getInstance() {
    synchronized (HanziToPinyin3.class) {
        if (sInstance != null) {
            return sInstance;
        }
        // Check if zh_CN collation data is available
        final Locale locale[] = Collator.getAvailableLocales();
        for (int i = 0; i < locale.length; i++) {
            if (locale[i].equals(Locale.CHINESE)) {
                // Do self validation just once.
                if (DEBUG) {
                    Log.d(TAG, "Self validation. Result: " + doSelfValidation());
                }
                sInstance = new HanziToPinyin3(true);
                return sInstance;
            }
        }
        Log.w(TAG, "There is no Chinese collator, HanziToPinyin is disabled");
        sInstance = new HanziToPinyin3(false);
        return sInstance;
    }
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:23,代码来源:HanziToPinyin3.java

示例4: TestGetAll

import java.text.Collator; //导入方法依赖的package包/类
public final void TestGetAll()
{
    Locale[] list = Collator.getAvailableLocales();
    for (int i = 0; i < list.length; ++i) {
        log("Locale name: ");
        log(list[i].toString());
        log(" , the display name is : ");
        logln(list[i].getDisplayName());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:APITest.java


注:本文中的java.text.Collator.getAvailableLocales方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。