本文整理了Java中org.apache.calcite.util.Util.parseLocale()
方法的一些代码示例,展示了Util.parseLocale()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.parseLocale()
方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:parseLocale
[英]Parses a locale string.
The inverse operation of java.util.Locale#toString().
[中]解析区域设置字符串。
java的逆运算。util。Locale#toString()。
代码示例来源:origin: Qihoo360/Quicksql
/**
* Unit test for {@link Util#parseLocale(String)} method.
*/
@Test public void testParseLocale() {
Locale[] locales = {
Locale.CANADA,
Locale.CANADA_FRENCH,
Locale.getDefault(),
Locale.US,
Locale.TRADITIONAL_CHINESE,
Locale.ROOT,
};
for (Locale locale : locales) {
assertEquals(locale, Util.parseLocale(locale.toString()));
}
// Example locale names in Locale.toString() javadoc.
String[] localeNames = {
"en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"
};
for (String localeName : localeNames) {
assertEquals(localeName, Util.parseLocale(localeName).toString());
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
/**
* Unit test for {@link Util#parseLocale(String)} method.
*/
@Test public void testParseLocale() {
Locale[] locales = {
Locale.CANADA,
Locale.CANADA_FRENCH,
Locale.getDefault(),
Locale.US,
Locale.TRADITIONAL_CHINESE,
Locale.ROOT,
};
for (Locale locale : locales) {
assertEquals(locale, Util.parseLocale(locale.toString()));
}
// Example locale names in Locale.toString() javadoc.
String[] localeNames = {
"en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"
};
for (String localeName : localeNames) {
assertEquals(localeName, Util.parseLocale(localeName).toString());
}
}
内容来源于网络,如有侵权,请联系作者删除!