org.apache.calcite.util.Util.parseLocale()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.apache.calcite.util.Util.parseLocale()方法的一些代码示例,展示了Util.parseLocale()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.parseLocale()方法的具体详情如下:
包路径:org.apache.calcite.util.Util
类名称:Util
方法名:parseLocale

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());
 }
}

相关文章