equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
392 cachedHashCode = 0; |
392 cachedHashCode = 0; |
393 } |
393 } |
394 |
394 |
395 /** |
395 /** |
396 * Gets month strings. For example: "January", "February", etc. |
396 * Gets month strings. For example: "January", "February", etc. |
|
397 * An array with either 12 or 13 elements will be returned depending |
|
398 * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} |
|
399 * is supported. Use |
|
400 * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, |
|
401 * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, |
|
402 * etc. to index the result array. |
397 * |
403 * |
398 * <p>If the language requires different forms for formatting and |
404 * <p>If the language requires different forms for formatting and |
399 * stand-alone usages, this method returns month names in the |
405 * stand-alone usages, this method returns month names in the |
400 * formatting form. For example, the preferred month name for |
406 * formatting form. For example, the preferred month name for |
401 * January in the Czech language is <em>ledna</em> in the |
407 * January in the Czech language is <em>ledna</em> in the |
403 * form. This method returns {@code "ledna"} in this case. Refer |
409 * form. This method returns {@code "ledna"} in this case. Refer |
404 * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements"> |
410 * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements"> |
405 * Calendar Elements in the Unicode Locale Data Markup Language |
411 * Calendar Elements in the Unicode Locale Data Markup Language |
406 * (LDML) specification</a> for more details. |
412 * (LDML) specification</a> for more details. |
407 * |
413 * |
408 * @return the month strings. Use |
414 * @implSpec This method returns 13 elements since |
409 * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, |
415 * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported. |
410 * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, |
416 * @return the month strings. |
411 * etc. to index the result array. |
|
412 */ |
417 */ |
413 public String[] getMonths() { |
418 public String[] getMonths() { |
414 return Arrays.copyOf(months, months.length); |
419 return Arrays.copyOf(months, months.length); |
415 } |
420 } |
416 |
421 |
425 cachedHashCode = 0; |
430 cachedHashCode = 0; |
426 } |
431 } |
427 |
432 |
428 /** |
433 /** |
429 * Gets short month strings. For example: "Jan", "Feb", etc. |
434 * Gets short month strings. For example: "Jan", "Feb", etc. |
|
435 * An array with either 12 or 13 elements will be returned depending |
|
436 * on whether or not {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} |
|
437 * is supported. Use |
|
438 * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, |
|
439 * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, |
|
440 * etc. to index the result array. |
430 * |
441 * |
431 * <p>If the language requires different forms for formatting and |
442 * <p>If the language requires different forms for formatting and |
432 * stand-alone usages, this method returns short month names in |
443 * stand-alone usages, this method returns short month names in |
433 * the formatting form. For example, the preferred abbreviation |
444 * the formatting form. For example, the preferred abbreviation |
434 * for January in the Catalan language is <em>de gen.</em> in the |
445 * for January in the Catalan language is <em>de gen.</em> in the |
436 * form. This method returns {@code "de gen."} in this case. Refer |
447 * form. This method returns {@code "de gen."} in this case. Refer |
437 * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements"> |
448 * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements"> |
438 * Calendar Elements in the Unicode Locale Data Markup Language |
449 * Calendar Elements in the Unicode Locale Data Markup Language |
439 * (LDML) specification</a> for more details. |
450 * (LDML) specification</a> for more details. |
440 * |
451 * |
441 * @return the short month strings. Use |
452 * @implSpec This method returns 13 elements since |
442 * {@link java.util.Calendar#JANUARY Calendar.JANUARY}, |
453 * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER} is supported. |
443 * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, |
454 * @return the short month strings. |
444 * etc. to index the result array. |
|
445 */ |
455 */ |
446 public String[] getShortMonths() { |
456 public String[] getShortMonths() { |
447 return Arrays.copyOf(shortMonths, shortMonths.length); |
457 return Arrays.copyOf(shortMonths, shortMonths.length); |
448 } |
458 } |
449 |
459 |