< prev index next >

src/java.base/share/classes/java/text/DateFormatSymbols.java

Print this page




 388      * @param newEras the new era strings.
 389      */
 390     public void setEras(String[] newEras) {
 391         eras = Arrays.copyOf(newEras, newEras.length);
 392         cachedHashCode = 0;
 393     }
 394 
 395     /**
 396      * Gets month strings. For example: "January", "February", etc.
 397      *
 398      * <p>If the language requires different forms for formatting and
 399      * stand-alone usages, this method returns month names in the
 400      * formatting form. For example, the preferred month name for
 401      * January in the Czech language is <em>ledna</em> in the
 402      * formatting form, while it is <em>leden</em> in the stand-alone
 403      * form. This method returns {@code "ledna"} in this case. Refer
 404      * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements">
 405      * Calendar Elements in the Unicode Locale Data Markup Language
 406      * (LDML) specification</a> for more details.
 407      *






 408      * @return the month strings. Use
 409      * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 410      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
 411      * etc. to index the result array.
 412      */
 413     public String[] getMonths() {
 414         return Arrays.copyOf(months, months.length);
 415     }
 416 
 417     /**
 418      * Sets month strings. For example: "January", "February", etc.
 419      * @param newMonths the new month strings. The array should
 420      * be indexed by {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 421      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, etc.
 422      */
 423     public void setMonths(String[] newMonths) {
 424         months = Arrays.copyOf(newMonths, newMonths.length);
 425         cachedHashCode = 0;
 426     }
 427 
 428     /**
 429      * Gets short month strings. For example: "Jan", "Feb", etc.
 430      *
 431      * <p>If the language requires different forms for formatting and
 432      * stand-alone usages, this method returns short month names in
 433      * the formatting form. For example, the preferred abbreviation
 434      * for January in the Catalan language is <em>de gen.</em> in the
 435      * formatting form, while it is <em>gen.</em> in the stand-alone
 436      * form. This method returns {@code "de gen."} in this case. Refer
 437      * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements">
 438      * Calendar Elements in the Unicode Locale Data Markup Language
 439      * (LDML) specification</a> for more details.
 440      *






 441      * @return the short month strings. Use
 442      * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 443      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
 444      * etc. to index the result array.
 445      */
 446     public String[] getShortMonths() {
 447         return Arrays.copyOf(shortMonths, shortMonths.length);
 448     }
 449 
 450     /**
 451      * Sets short month strings. For example: "Jan", "Feb", etc.
 452      * @param newShortMonths the new short month strings. The array should
 453      * be indexed by {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 454      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, etc.
 455      */
 456     public void setShortMonths(String[] newShortMonths) {
 457         shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length);
 458         cachedHashCode = 0;
 459     }
 460 




 388      * @param newEras the new era strings.
 389      */
 390     public void setEras(String[] newEras) {
 391         eras = Arrays.copyOf(newEras, newEras.length);
 392         cachedHashCode = 0;
 393     }
 394 
 395     /**
 396      * Gets month strings. For example: "January", "February", etc.
 397      *
 398      * <p>If the language requires different forms for formatting and
 399      * stand-alone usages, this method returns month names in the
 400      * formatting form. For example, the preferred month name for
 401      * January in the Czech language is <em>ledna</em> in the
 402      * formatting form, while it is <em>leden</em> in the stand-alone
 403      * form. This method returns {@code "ledna"} in this case. Refer
 404      * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements">
 405      * Calendar Elements in the Unicode Locale Data Markup Language
 406      * (LDML) specification</a> for more details.
 407      * 
 408      * @implNote The default implementation returns month string
 409      * array of 13 elements, the thirteenth element is for
 410      * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER},
 411      * in which an empty string is returned for
 412      * {@code GregorianCalendar}.
 413      *
 414      * @return the month strings. Use
 415      * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 416      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
 417      * etc. to index the result array.
 418      */
 419     public String[] getMonths() {
 420         return Arrays.copyOf(months, months.length);
 421     }
 422 
 423     /**
 424      * Sets month strings. For example: "January", "February", etc.
 425      * @param newMonths the new month strings. The array should
 426      * be indexed by {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 427      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, etc.
 428      */
 429     public void setMonths(String[] newMonths) {
 430         months = Arrays.copyOf(newMonths, newMonths.length);
 431         cachedHashCode = 0;
 432     }
 433 
 434     /**
 435      * Gets short month strings. For example: "Jan", "Feb", etc.
 436      *
 437      * <p>If the language requires different forms for formatting and
 438      * stand-alone usages, this method returns short month names in
 439      * the formatting form. For example, the preferred abbreviation
 440      * for January in the Catalan language is <em>de gen.</em> in the
 441      * formatting form, while it is <em>gen.</em> in the stand-alone
 442      * form. This method returns {@code "de gen."} in this case. Refer
 443      * to the <a href="http://unicode.org/reports/tr35/#Calendar_Elements">
 444      * Calendar Elements in the Unicode Locale Data Markup Language
 445      * (LDML) specification</a> for more details.
 446      *
 447      * @implNote The default implementation returns short month string
 448      * array of 13 elements, the thirteenth element is for
 449      * {@link java.util.Calendar#UNDECIMBER Calendar.UNDECIMBER},
 450      * in which an empty string is returned for
 451      * {@code GregorianCalendar}.
 452      * 
 453      * @return the short month strings. Use
 454      * {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 455      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY},
 456      * etc. to index the result array.
 457      */
 458     public String[] getShortMonths() {
 459         return Arrays.copyOf(shortMonths, shortMonths.length);
 460     }
 461 
 462     /**
 463      * Sets short month strings. For example: "Jan", "Feb", etc.
 464      * @param newShortMonths the new short month strings. The array should
 465      * be indexed by {@link java.util.Calendar#JANUARY Calendar.JANUARY},
 466      * {@link java.util.Calendar#FEBRUARY Calendar.FEBRUARY}, etc.
 467      */
 468     public void setShortMonths(String[] newShortMonths) {
 469         shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length);
 470         cachedHashCode = 0;
 471     }
 472 


< prev index next >