java.util.Calendar.getAvailableLocales()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(174)

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

Calendar.getAvailableLocales介绍

[英]Returns an array of locales for which custom Calendar instances are available.

Note that Android does not support user-supplied locale service providers.
[中]返回可用于自定义日历实例的区域设置数组。
请注意,Android不支持用户提供的区域设置服务提供商。

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * Returns the list of locales for which Calendars are installed.
 * @return the list of locales for which Calendars are installed.
 * @stable ICU 2.0
 */
public static Locale[] getAvailableLocales()
{
  return java.util.Calendar.getAvailableLocales();
}

代码示例来源:origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * Returns the list of locales for which Calendars are installed.
 * @return the list of locales for which Calendars are installed.
 * @stable ICU 2.0
 */
public static Locale[] getAvailableLocales()
{
  return java.util.Calendar.getAvailableLocales();
}

代码示例来源:origin: stackoverflow.com

for (Locale locale : Calendar.getAvailableLocales()) {
 if (locale.getCountry().length() > 0
   && Calendar.getInstance(locale) instanceof GregorianCalendar) {
  addItem(locale.getDisplayName());
 }
}

代码示例来源:origin: stackoverflow.com

Locale[] locales = Calendar.getAvailableLocales();
//Convert to list in order to remove some elements
List<Locale> locales2 = new ArrayList<Locale>(Arrays.asList(locales));
int localeCount = locales2.size();
for (int j = 0; j < localeCount; j++) {
  if (!(locales2.get(j).getCountry().length() > 0)) {
    locales2.remove(j);
    localeCount--;
  }
}
//Now loop over the list in search for the selected locale
for (int i = 0; i < localeCount; i++) {
  if (locales2.get(i).getDisplayName().equals(**whatever the user chose**)) {
    myLocale = locales2.get(i);
    break;
  }
}

代码示例来源:origin: EvoSuite/evosuite

public static synchronized Locale[] getAvailableLocales()
{
  Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, CaptureUtil.loadClass("java/util/Calendar"), "getAvailableLocales", "()[Ljava/util/Locale;", new Object[] {});
  Locale[] ret = java.util.Calendar.getAvailableLocales();
  Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, CaptureUtil.loadClass("java/util/Calendar"), ret);
  return ret;
}

相关文章