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

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

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

Calendar.insertValuesInMap介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. * <p>
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Returns a map of human-readable strings to corresponding values,
  3. * for the given field, style, and locale.
  4. * Returns null if no strings are available.
  5. *
  6. * <p>For example, {@code getDisplayNames(MONTH, ALL_STYLES, Locale.US)} would
  7. * contain mappings from "Jan" and "January" to {@link #JANUARY}, and so on.
  8. *
  9. * @param field the field
  10. * @param style {@code SHORT}, {@code LONG}, or {@code ALL_STYLES}
  11. * @param locale the locale
  12. * @return the display name, or null
  13. * @throws NullPointerException if {@code locale == null}
  14. * @throws IllegalArgumentException if {@code field} or {@code style} is invalid
  15. * @since 1.6
  16. */
  17. public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
  18. checkStyle(style);
  19. complete();
  20. Map<String, Integer> result = new HashMap<String, Integer>();
  21. if (style == SHORT || style == ALL_STYLES) {
  22. insertValuesInMap(result, getDisplayNameArray(field, SHORT, locale));
  23. }
  24. if (style == LONG || style == ALL_STYLES) {
  25. insertValuesInMap(result, getDisplayNameArray(field, LONG, locale));
  26. }
  27. return result.isEmpty() ? null : result;
  28. }

相关文章