本文整理匯總了Java中java.util.Locale.KOREAN屬性的典型用法代碼示例。如果您正苦於以下問題:Java Locale.KOREAN屬性的具體用法?Java Locale.KOREAN怎麽用?Java Locale.KOREAN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.util.Locale
的用法示例。
在下文中一共展示了Locale.KOREAN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isSharedFlyweight
private static boolean isSharedFlyweight(Object obj) {
if (obj == null) {
return true;
}
if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
return true;
}
if (/* obj == Locale.ROOT || *//* Java 6 */
obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
|| obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
|| obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
|| obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
|| obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
|| obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
return true;
}
if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
return true;
}
if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
return true;
}
if (obj == System.in || obj == System.out || obj == System.err) {
return true;
}
if (obj == String.CASE_INSENSITIVE_ORDER) {
return true;
}
if (obj == JarFile.MANIFEST_NAME) {
return true;
}
return false;
}
示例2: getLocale
private Locale getLocale(String localeName) {
String language, country;
int index;
index = localeName.indexOf('_');
if (index == -1) {
//
// Special case the builtin JDK languages
//
if (localeName.equals("de"))
return Locale.GERMAN;
if (localeName.equals("en"))
return Locale.ENGLISH;
if (localeName.equals("fr"))
return Locale.FRENCH;
if (localeName.equals("it"))
return Locale.ITALIAN;
if (localeName.equals("ja"))
return Locale.JAPANESE;
if (localeName.equals("ko"))
return Locale.KOREAN;
if (localeName.equals("zh"))
return Locale.CHINESE;
language = localeName;
country = "";
} else {
if (localeName.equals("zh_CN"))
return Locale.SIMPLIFIED_CHINESE;
if (localeName.equals("zh_TW"))
return Locale.TRADITIONAL_CHINESE;
//
// JDK also has constants for countries: en_GB, en_US, en_CA,
// fr_FR, fr_CA, de_DE, ja_JP, ko_KR. We don't use those.
//
language = localeName.substring(0, index);
country = localeName.substring(index + 1);
}
return new Locale(language, country);
}
示例3: testNotExistingLocale
@Test
public void testNotExistingLocale() {
//Change if this locale is added.
Locale locale = Locale.KOREAN;
Assert.assertEquals("Test string.", Language.get("test.TestString"));
}