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

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

本文整理了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

  1. /**
  2. * Returns the list of locales for which Calendars are installed.
  3. * @return the list of locales for which Calendars are installed.
  4. * @stable ICU 2.0
  5. */
  6. public static Locale[] getAvailableLocales()
  7. {
  8. return java.util.Calendar.getAvailableLocales();
  9. }

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

  1. /**
  2. * Returns the list of locales for which Calendars are installed.
  3. * @return the list of locales for which Calendars are installed.
  4. * @stable ICU 2.0
  5. */
  6. public static Locale[] getAvailableLocales()
  7. {
  8. return java.util.Calendar.getAvailableLocales();
  9. }

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

  1. for (Locale locale : Calendar.getAvailableLocales()) {
  2. if (locale.getCountry().length() > 0
  3. && Calendar.getInstance(locale) instanceof GregorianCalendar) {
  4. addItem(locale.getDisplayName());
  5. }
  6. }

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

  1. Locale[] locales = Calendar.getAvailableLocales();
  2. //Convert to list in order to remove some elements
  3. List<Locale> locales2 = new ArrayList<Locale>(Arrays.asList(locales));
  4. int localeCount = locales2.size();
  5. for (int j = 0; j < localeCount; j++) {
  6. if (!(locales2.get(j).getCountry().length() > 0)) {
  7. locales2.remove(j);
  8. localeCount--;
  9. }
  10. }
  11. //Now loop over the list in search for the selected locale
  12. for (int i = 0; i < localeCount; i++) {
  13. if (locales2.get(i).getDisplayName().equals(**whatever the user chose**)) {
  14. myLocale = locales2.get(i);
  15. break;
  16. }
  17. }

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

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

相关文章