Home | History | Annotate | Download | only in text
      1 //  2016 and later: Unicode, Inc. and others.
      2 // License & terms of use: http://www.unicode.org/copyright.html#License
      3 /*
      4  *******************************************************************************
      5  * Copyright (C) 1996-2012, International Business Machines Corporation and    *
      6  * others. All Rights Reserved.                                                *
      7  *******************************************************************************
      8  */
      9 
     10 package com.ibm.icu.text;
     11 
     12 import java.io.Serializable;
     13 import java.util.Locale;
     14 
     15 import com.ibm.icu.util.ULocale;
     16 import com.ibm.icu.util.ULocale.Category;
     17 
     18 /**
     19  * {@icuenhanced java.text.DateFormatSymbols}.{@icu _usage_}
     20  *
     21  * <p><code>DateFormatSymbols</code> is a public class for encapsulating
     22  * localizable date-time formatting data, such as the names of the
     23  * months, the names of the days of the week, and the time zone data.
     24  * <code>DateFormat</code> and <code>SimpleDateFormat</code> both use
     25  * <code>DateFormatSymbols</code> to encapsulate this information.
     26  *
     27  * <p>Typically you shouldn't use <code>DateFormatSymbols</code> directly.
     28  * Rather, you are encouraged to create a date-time formatter with the
     29  * <code>DateFormat</code> class's factory methods: <code>getTimeInstance</code>,
     30  * <code>getDateInstance</code>, or <code>getDateTimeInstance</code>.
     31  * These methods automatically create a <code>DateFormatSymbols</code> for
     32  * the formatter so that you don't have to. After the
     33  * formatter is created, you may modify its format pattern using the
     34  * <code>setPattern</code> method. For more information about
     35  * creating formatters using <code>DateFormat</code>'s factory methods,
     36  * see {@link DateFormat}.
     37  *
     38  * <p>If you decide to create a date-time formatter with a specific
     39  * format pattern for a specific locale, you can do so with:
     40  * <blockquote>
     41  * <pre>
     42  * new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
     43  * </pre>
     44  * </blockquote>
     45  *
     46  * <p><code>DateFormatSymbols</code> objects are clonable. When you obtain
     47  * a <code>DateFormatSymbols</code> object, feel free to modify the
     48  * date-time formatting data. For instance, you can replace the localized
     49  * date-time format pattern characters with the ones that you feel easy
     50  * to remember. Or you can change the representative cities
     51  * to your favorite ones.
     52  *
     53  * <p>New <code>DateFormatSymbols</code> subclasses may be added to support
     54  * <code>SimpleDateFormat</code> for date-time formatting for additional locales.
     55  *
     56  * @see          DateFormat
     57  * @see          SimpleDateFormat
     58  * @see          com.ibm.icu.util.SimpleTimeZone
     59  * @author       Chen-Lieh Huang
     60  * @stable ICU 2.0
     61  */
     62 public class DateFormatSymbols implements Serializable, Cloneable {
     63 
     64     private static final long serialVersionUID = 1L;
     65 
     66     /** @internal */
     67     public java.text.DateFormatSymbols dfs;
     68 
     69     /** @internal */
     70     public DateFormatSymbols(java.text.DateFormatSymbols delegate) {
     71         this.dfs = delegate;
     72     }
     73 
     74     // TODO make sure local pattern char string is 18 characters long,
     75     // that is, that it encompasses the new 'u' char for
     76     // EXTENDED_YEAR.  Two options: 1. Make sure resource data is
     77     // correct; 2. Make code add in 'u' at end if len == 17.
     78 
     79     // Constants for context
     80     /**
     81      * {@icu} Constant for context.
     82      * @stable ICU 3.6
     83      */
     84     public static final int FORMAT = 0;
     85 
     86     /**
     87      * {@icu} Constant for context.
     88      * @stable ICU 3.6
     89      */
     90     public static final int STANDALONE = 1;
     91 
     92     /**
     93      * {@icu} Constant for context.
     94      * @internal
     95      * @deprecated This API is ICU internal only.
     96      */
     97     public static final int DT_CONTEXT_COUNT = 2;
     98 
     99     // Constants for width
    100 
    101     /**
    102      * {@icu} Constant for width.
    103      * @stable ICU 3.6
    104      */
    105     public static final int ABBREVIATED = 0;
    106 
    107     /**
    108      * {@icu} Constant for width.
    109      * @stable ICU 3.6
    110      */
    111     public static final int WIDE = 1;
    112 
    113     /**
    114      * {@icu} Constant for width.
    115      * @stable ICU 3.6
    116      */
    117     public static final int NARROW = 2;
    118 
    119     /**
    120      * {@icu} Constant for width.
    121      * @internal
    122      * @deprecated This API is ICU internal only.
    123      */
    124     public static final int DT_WIDTH_COUNT = 3;
    125 
    126     /**
    127      * Constructs a DateFormatSymbols object by loading format data from
    128      * resources for the default locale.
    129      *
    130      * @throws java.util.MissingResourceException if the resources for the default locale
    131      *          cannot be found or cannot be loaded.
    132      * @stable ICU 2.0
    133      */
    134     public DateFormatSymbols()
    135     {
    136         this(new java.text.DateFormatSymbols(ULocale.getDefault(Category.FORMAT).toLocale()));
    137     }
    138 
    139     /**
    140      * Constructs a DateFormatSymbols object by loading format data from
    141      * resources for the given locale.
    142      *
    143      * @throws java.util.MissingResourceException if the resources for the specified
    144      *          locale cannot be found or cannot be loaded.
    145      * @stable ICU 2.0
    146      */
    147     public DateFormatSymbols(Locale locale)
    148     {
    149         this(new java.text.DateFormatSymbols(locale));
    150     }
    151 
    152     /**
    153      * {@icu} Constructs a DateFormatSymbols object by loading format data from
    154      * resources for the given ulocale.
    155      *
    156      * @throws java.util.MissingResourceException if the resources for the specified
    157      *          locale cannot be found or cannot be loaded.
    158      * @stable ICU 3.2
    159      */
    160     public DateFormatSymbols(ULocale locale)
    161     {
    162         this(new java.text.DateFormatSymbols(locale.toLocale()));
    163     }
    164 
    165     /**
    166      * Returns a DateFormatSymbols instance for the default locale.
    167      *
    168      * {@icunote} Unlike <code>java.text.DateFormatSymbols#getInstance</code>,
    169      * this method simply returns <code>new com.ibm.icu.text.DateFormatSymbols()</code>.
    170      * ICU does not support <code>DateFormatSymbolsProvider</code> introduced in Java 6
    171      * or its equivalent implementation for now.
    172      *
    173      * @return A DateFormatSymbols instance.
    174      * @stable ICU 3.8
    175      */
    176     public static DateFormatSymbols getInstance() {
    177         return new DateFormatSymbols();
    178     }
    179 
    180     /**
    181      * Returns a DateFormatSymbols instance for the given locale.
    182      *
    183      * {@icunote} Unlike <code>java.text.DateFormatSymbols#getInstance</code>,
    184      * this method simply returns <code>new com.ibm.icu.text.DateFormatSymbols(locale)</code>.
    185      * ICU does not support <code>DateFormatSymbolsProvider</code> introduced in Java 6
    186      * or its equivalent implementation for now.
    187      *
    188      * @param locale the locale.
    189      * @return A DateFormatSymbols instance.
    190      * @stable ICU 3.8
    191      */
    192     public static DateFormatSymbols getInstance(Locale locale) {
    193         return new DateFormatSymbols(new java.text.DateFormatSymbols(locale));
    194     }
    195 
    196     /**
    197      * {@icu} Returns a DateFormatSymbols instance for the given locale.
    198      *
    199      * {@icunote} Unlike <code>java.text.DateFormatSymbols#getInstance</code>,
    200      * this method simply returns <code>new com.ibm.icu.text.DateFormatSymbols(locale)</code>.
    201      * ICU does not support <code>DateFormatSymbolsProvider</code> introduced in Java 6
    202      * or its equivalent implementation for now.
    203      *
    204      * @param locale the locale.
    205      * @return A DateFormatSymbols instance.
    206      * @stable ICU 3.8
    207      */
    208     public static DateFormatSymbols getInstance(ULocale locale) {
    209         return new DateFormatSymbols(new java.text.DateFormatSymbols(locale.toLocale()));
    210     }
    211 
    212     /**
    213      * Returns an array of all locales for which the <code>getInstance</code> methods of
    214      * this class can return localized instances.
    215      *
    216      * {@icunote} Unlike <code>java.text.DateFormatSymbols#getAvailableLocales</code>,
    217      * this method simply returns the array of <code>Locale</code>s available in this
    218      * class.  ICU does not support <code>DateFormatSymbolsProvider</code> introduced in
    219      * Java 6 or its equivalent implementation for now.
    220      *
    221      * @return An array of <code>Locale</code>s for which localized
    222      * <code>DateFormatSymbols</code> instances are available.
    223      * @stable ICU 3.8
    224      */
    225     public static Locale[] getAvailableLocales() {
    226         return java.text.DateFormat.getAvailableLocales();
    227     }
    228 
    229     /**
    230      * {@icu} Returns an array of all locales for which the <code>getInstance</code>
    231      * methods of this class can return localized instances.
    232      *
    233      * {@icunote} Unlike <code>java.text.DateFormatSymbols#getAvailableLocales</code>,
    234      * this method simply returns the array of <code>ULocale</code>s available in this
    235      * class.  ICU does not support <code>DateFormatSymbolsProvider</code> introduced in
    236      * Java 6 or its equivalent implementation for now.
    237      *
    238      * @return An array of <code>ULocale</code>s for which localized
    239      * <code>DateFormatSymbols</code> instances are available.
    240      * @draft ICU 3.8 (retain)
    241      * @provisional This API might change or be removed in a future release.
    242      */
    243     public static ULocale[] getAvailableULocales() {
    244         Locale[] locales = getAvailableLocales();
    245         ULocale[] ulocales = new ULocale[locales.length];
    246         for (int i = 0; i < locales.length; ++i) {
    247             ulocales[i] = ULocale.forLocale(locales[i]);
    248         }
    249         return ulocales;
    250     }
    251 
    252     /**
    253      * Returns era strings. For example: "AD" and "BC".
    254      * @return the era strings.
    255      * @stable ICU 2.0
    256      */
    257     public String[] getEras() {
    258         return dfs.getEras();
    259     }
    260 
    261     /**
    262      * Sets era strings. For example: "AD" and "BC".
    263      * @param newEras the new era strings.
    264      * @stable ICU 2.0
    265      */
    266     public void setEras(String[] newEras) {
    267         dfs.setEras(newEras);
    268     }
    269 
    270     /**
    271      * {@icu} Returns era name strings. For example: "Anno Domini" and "Before Christ".
    272      * @return the era strings.
    273      * @stable ICU 3.4
    274      */
    275     public String[] getEraNames() {
    276         return getEras(); // Java has no distinction between era strings and era name strings
    277     }
    278 
    279     /**
    280      * {@icu} Sets era name strings. For example: "Anno Domini" and "Before Christ".
    281      * @param newEraNames the new era strings.
    282      * @stable ICU 3.8
    283      */
    284     public void setEraNames(String[] newEraNames) {
    285         setEras(newEraNames); // Java has no distinction between era strings and era name strings
    286     }
    287 
    288     /**
    289      * Returns month strings. For example: "January", "February", etc.
    290      * @return the month strings.
    291      * @stable ICU 2.0
    292      */
    293     public String[] getMonths() {
    294         return dfs.getMonths();
    295     }
    296 
    297     /**
    298      * Returns month strings. For example: "January", "February", etc.
    299      * @param context    The month context, FORMAT or STANDALONE.
    300      * @param width      The width or the returned month string,
    301      *                   either WIDE, ABBREVIATED, or NARROW.
    302      * @return the month strings.
    303      * @stable ICU 3.4
    304      */
    305     public String[] getMonths(int context, int width) {
    306         // JDK does not support context / narrow months
    307         switch (width) {
    308         case WIDE:
    309             return dfs.getMonths();
    310 
    311         case ABBREVIATED:
    312         case NARROW:
    313             return dfs.getShortMonths();
    314 
    315         default:
    316             throw new IllegalArgumentException("Unsupported width argument value");
    317         }
    318     }
    319 
    320     /**
    321      * Sets month strings. For example: "January", "February", etc.
    322      * @param newMonths the new month strings.
    323      * @stable ICU 2.0
    324      */
    325     public void setMonths(String[] newMonths) {
    326         dfs.setMonths(newMonths);
    327     }
    328 
    329     /**
    330      * Sets month strings. For example: "January", "February", etc.
    331      * @param newMonths the new month strings.
    332      * @param context    The formatting context, FORMAT or STANDALONE.
    333      * @param width      The width of the month string,
    334      *                   either WIDE, ABBREVIATED, or NARROW.
    335      * @stable ICU 3.8
    336      */
    337     public void setMonths(String[] newMonths, int context, int width) {
    338         // JDK does not support context / narrow months
    339         switch (width) {
    340         case WIDE:
    341             dfs.setMonths(newMonths);
    342             break;
    343 
    344         case ABBREVIATED:
    345         case NARROW:
    346             dfs.setShortMonths(newMonths);
    347             break;
    348 
    349         default:
    350             throw new IllegalArgumentException("Unsupported width argument value");
    351         }
    352     }
    353 
    354     /**
    355      * Returns short month strings. For example: "Jan", "Feb", etc.
    356      * @return the short month strings.
    357      * @stable ICU 2.0
    358      */
    359     public String[] getShortMonths() {
    360         return dfs.getShortMonths();
    361     }
    362 
    363     /**
    364      * Sets short month strings. For example: "Jan", "Feb", etc.
    365      * @param newShortMonths the new short month strings.
    366      * @stable ICU 2.0
    367      */
    368     public void setShortMonths(String[] newShortMonths) {
    369         dfs.setShortMonths(newShortMonths);
    370     }
    371 
    372     /**
    373      * Returns weekday strings. For example: "Sunday", "Monday", etc.
    374      * @return the weekday strings. Use <code>Calendar.SUNDAY</code>,
    375      * <code>Calendar.MONDAY</code>, etc. to index the result array.
    376      * @stable ICU 2.0
    377      */
    378     public String[] getWeekdays() {
    379         return dfs.getWeekdays();
    380     }
    381 
    382     /**
    383      * Returns weekday strings. For example: "Sunday", "Monday", etc.
    384      * @return the weekday strings. Use <code>Calendar.SUNDAY</code>,
    385      * <code>Calendar.MONDAY</code>, etc. to index the result array.
    386      * @param context    Formatting context, either FORMAT or STANDALONE.
    387      * @param width      Width of strings to be returned, either
    388      *                   WIDE, ABBREVIATED, or NARROW
    389      * @stable ICU 3.4
    390      */
    391     public String[] getWeekdays(int context, int width) {
    392         // JDK does not support context / narrow weekdays
    393         switch (width) {
    394         case WIDE:
    395             return dfs.getWeekdays();
    396 
    397         case ABBREVIATED:
    398         case NARROW:
    399             return dfs.getShortWeekdays();
    400 
    401         default:
    402             throw new IllegalArgumentException("Unsupported width argument value");
    403         }
    404     }
    405 
    406     /**
    407      * Sets weekday strings. For example: "Sunday", "Monday", etc.
    408      * @param newWeekdays The new weekday strings.
    409      * @param context     The formatting context, FORMAT or STANDALONE.
    410      * @param width       The width of the strings,
    411      *                    either WIDE, ABBREVIATED, or NARROW.
    412      * @stable ICU 3.8
    413      */
    414     public void setWeekdays(String[] newWeekdays, int context, int width) {
    415         // JDK does not support context / narrow weekdays
    416         switch (width) {
    417         case WIDE:
    418             dfs.setWeekdays(newWeekdays);
    419             break;
    420 
    421         case ABBREVIATED:
    422         case NARROW:
    423             dfs.setShortWeekdays(newWeekdays);
    424             break;
    425 
    426         default:
    427             throw new IllegalArgumentException("Unsupported width argument value");
    428         }
    429     }
    430 
    431     /**
    432      * Sets weekday strings. For example: "Sunday", "Monday", etc.
    433      * @param newWeekdays the new weekday strings. The array should
    434      * be indexed by <code>Calendar.SUNDAY</code>,
    435      * <code>Calendar.MONDAY</code>, etc.
    436      * @stable ICU 2.0
    437      */
    438     public void setWeekdays(String[] newWeekdays) {
    439         dfs.setWeekdays(newWeekdays);
    440     }
    441 
    442     /**
    443      * Returns short weekday strings. For example: "Sun", "Mon", etc.
    444      * @return the short weekday strings. Use <code>Calendar.SUNDAY</code>,
    445      * <code>Calendar.MONDAY</code>, etc. to index the result array.
    446      * @stable ICU 2.0
    447      */
    448     public String[] getShortWeekdays() {
    449         return dfs.getShortWeekdays();
    450     }
    451 
    452     /**
    453      * Sets short weekday strings. For example: "Sun", "Mon", etc.
    454      * @param newShortWeekdays the new short weekday strings. The array should
    455      * be indexed by <code>Calendar.SUNDAY</code>,
    456      * <code>Calendar.MONDAY</code>, etc.
    457      * @stable ICU 2.0
    458      */
    459     public void setShortWeekdays(String[] newShortWeekdays) {
    460         dfs.setShortWeekdays(newShortWeekdays);
    461     }
    462 
    463 //    /**
    464 //     * {@icu} Returns quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
    465 //     * @param context    The quarter context, FORMAT or STANDALONE.
    466 //     * @param width      The width or the returned quarter string,
    467 //     *                   either WIDE or ABBREVIATED. There are no NARROW quarters.
    468 //     * @return the quarter strings.
    469 //     * @stable ICU 3.6
    470 //     */
    471 //    public String[] getQuarters(int context, int width) {
    472 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    473 //    }
    474 
    475 //    /**
    476 //     * {@icu} Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
    477 //     * @param newQuarters the new quarter strings.
    478 //     * @param context    The formatting context, FORMAT or STANDALONE.
    479 //     * @param width      The width of the quarter string,
    480 //     *                   either WIDE or ABBREVIATED. There are no NARROW quarters.
    481 //     * @stable ICU 3.8
    482 //     */
    483 //    public void setQuarters(String[] newQuarters, int context, int width) {
    484 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    485 //    }
    486 
    487     /**
    488      * Returns am/pm strings. For example: "AM" and "PM".
    489      * @return the weekday strings.
    490      * @stable ICU 2.0
    491      */
    492     public String[] getAmPmStrings() {
    493         return dfs.getAmPmStrings();
    494     }
    495 
    496     /**
    497      * Sets am/pm strings. For example: "AM" and "PM".
    498      * @param newAmpms the new ampm strings.
    499      * @stable ICU 2.0
    500      */
    501     public void setAmPmStrings(String[] newAmpms) {
    502         dfs.setAmPmStrings(newAmpms);
    503     }
    504 
    505     /**
    506      * Returns timezone strings.
    507      * @return the timezone strings.
    508      * @stable ICU 2.0
    509      */
    510     public String[][] getZoneStrings() {
    511         return dfs.getZoneStrings();
    512     }
    513 
    514     /**
    515      * Sets timezone strings.
    516      * @param newZoneStrings the new timezone strings.
    517      * @stable ICU 2.0
    518      */
    519     public void setZoneStrings(String[][] newZoneStrings) {
    520         dfs.setZoneStrings(newZoneStrings);
    521     }
    522 
    523     /**
    524      * Returns localized date-time pattern characters. For example: 'u', 't', etc.
    525      *
    526      * <p>Note: ICU no longer provides localized date-time pattern characters for a locale
    527      * starting ICU 3.8.  This method returns the non-localized date-time pattern
    528      * characters unless user defined localized data is set by setLocalPatternChars.
    529      * @return the localized date-time pattern characters.
    530      * @stable ICU 2.0
    531      */
    532     public String getLocalPatternChars() {
    533         return dfs.getLocalPatternChars();
    534     }
    535 
    536     /**
    537      * Sets localized date-time pattern characters. For example: 'u', 't', etc.
    538      * @param newLocalPatternChars the new localized date-time
    539      * pattern characters.
    540      * @stable ICU 2.0
    541      */
    542     public void setLocalPatternChars(String newLocalPatternChars) {
    543         dfs.setLocalPatternChars(newLocalPatternChars);
    544     }
    545 
    546     /**
    547      * Overrides clone.
    548      * @stable ICU 2.0
    549      */
    550     public Object clone()
    551     {
    552         return new DateFormatSymbols((java.text.DateFormatSymbols)dfs.clone());
    553     }
    554 
    555     /**
    556      * Override hashCode.
    557      * Generates a hash code for the DateFormatSymbols object.
    558      * @stable ICU 2.0
    559      */
    560     public int hashCode() {
    561         return dfs.hashCode();
    562     }
    563 
    564     /**
    565      * Overrides equals.
    566      * @stable ICU 2.0
    567      */
    568     public boolean equals(Object obj)
    569     {
    570         try {
    571             return dfs.equals(((DateFormatSymbols)obj).dfs);
    572         }
    573         catch (Exception e) {
    574             return false;
    575         }
    576     }
    577 
    578     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    579 
    580 //    /**
    581 //     * Returns the {@link DateFormatSymbols} object that should be used to format a
    582 //     * calendar system's dates in the given locale.
    583 //     * <p>
    584 //     * <b>Subclassing:</b><br>
    585 //     * When creating a new Calendar subclass, you must create the
    586 //     * {@link ResourceBundle ResourceBundle}
    587 //     * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
    588 //     * The resource bundle name is based on the calendar's fully-specified
    589 //     * class name, with ".resources" inserted at the end of the package name
    590 //     * (just before the class name) and "Symbols" appended to the end.
    591 //     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
    592 //     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
    593 //     * <p>
    594 //     * Within the ResourceBundle, this method searches for five keys:
    595 //     * <ul>
    596 //     * <li><b>DayNames</b> -
    597 //     *      An array of strings corresponding to each possible
    598 //     *      value of the <code>DAY_OF_WEEK</code> field.  Even though
    599 //     *      <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
    600 //     *      This array is 0-based; the name for Sunday goes in the
    601 //     *      first position, at index 0.  If this key is not found
    602 //     *      in the bundle, the day names are inherited from the
    603 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    604 //     *
    605 //     * <li><b>DayAbbreviations</b> -
    606 //     *      An array of abbreviated day names corresponding
    607 //     *      to the values in the "DayNames" array.  If this key
    608 //     *      is not found in the resource bundle, the "DayNames"
    609 //     *      values are used instead.  If neither key is found,
    610 //     *      the day abbreviations are inherited from the default
    611 //     *      <code>DateFormatSymbols</code> for the locale.
    612 //     *
    613 //     * <li><b>MonthNames</b> -
    614 //     *      An array of strings corresponding to each possible
    615 //     *      value of the <code>MONTH</code> field.  If this key is not found
    616 //     *      in the bundle, the month names are inherited from the
    617 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    618 //     *
    619 //     * <li><b>MonthAbbreviations</b> -
    620 //     *      An array of abbreviated day names corresponding
    621 //     *      to the values in the "MonthNames" array.  If this key
    622 //     *      is not found in the resource bundle, the "MonthNames"
    623 //     *      values are used instead.  If neither key is found,
    624 //     *      the day abbreviations are inherited from the default
    625 //     *      <code>DateFormatSymbols</code> for the locale.
    626 //     *
    627 //     * <li><b>Eras</b> -
    628 //     *      An array of strings corresponding to each possible
    629 //     *      value of the <code>ERA</code> field.  If this key is not found
    630 //     *      in the bundle, the era names are inherited from the
    631 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    632 //     * </ul>
    633 //     * <p>
    634 //     * @param cal       The calendar system whose date format symbols are desired.
    635 //     * @param locale    The locale whose symbols are desired.
    636 //     *
    637 //     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
    638 //     * @stable ICU 2.0
    639 //     */
    640 //    public DateFormatSymbols(Calendar cal, Locale locale) {
    641 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    642 //    }
    643 
    644 //    /**
    645 //     * Returns the {@link DateFormatSymbols} object that should be used to format a
    646 //     * calendar system's dates in the given locale.
    647 //     * <p>
    648 //     * <b>Subclassing:</b><br>
    649 //     * When creating a new Calendar subclass, you must create the
    650 //     * {@link ResourceBundle ResourceBundle}
    651 //     * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
    652 //     * The resource bundle name is based on the calendar's fully-specified
    653 //     * class name, with ".resources" inserted at the end of the package name
    654 //     * (just before the class name) and "Symbols" appended to the end.
    655 //     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
    656 //     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
    657 //     * <p>
    658 //     * Within the ResourceBundle, this method searches for five keys:
    659 //     * <ul>
    660 //     * <li><b>DayNames</b> -
    661 //     *      An array of strings corresponding to each possible
    662 //     *      value of the <code>DAY_OF_WEEK</code> field.  Even though
    663 //     *      <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
    664 //     *      This array is 0-based; the name for Sunday goes in the
    665 //     *      first position, at index 0.  If this key is not found
    666 //     *      in the bundle, the day names are inherited from the
    667 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    668 //     *
    669 //     * <li><b>DayAbbreviations</b> -
    670 //     *      An array of abbreviated day names corresponding
    671 //     *      to the values in the "DayNames" array.  If this key
    672 //     *      is not found in the resource bundle, the "DayNames"
    673 //     *      values are used instead.  If neither key is found,
    674 //     *      the day abbreviations are inherited from the default
    675 //     *      <code>DateFormatSymbols</code> for the locale.
    676 //     *
    677 //     * <li><b>MonthNames</b> -
    678 //     *      An array of strings corresponding to each possible
    679 //     *      value of the <code>MONTH</code> field.  If this key is not found
    680 //     *      in the bundle, the month names are inherited from the
    681 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    682 //     *
    683 //     * <li><b>MonthAbbreviations</b> -
    684 //     *      An array of abbreviated day names corresponding
    685 //     *      to the values in the "MonthNames" array.  If this key
    686 //     *      is not found in the resource bundle, the "MonthNames"
    687 //     *      values are used instead.  If neither key is found,
    688 //     *      the day abbreviations are inherited from the default
    689 //     *      <code>DateFormatSymbols</code> for the locale.
    690 //     *
    691 //     * <li><b>Eras</b> -
    692 //     *      An array of strings corresponding to each possible
    693 //     *      value of the <code>ERA</code> field.  If this key is not found
    694 //     *      in the bundle, the era names are inherited from the
    695 //     *      default <code>DateFormatSymbols</code> for the requested locale.
    696 //     * </ul>
    697 //     * <p>
    698 //     * @param cal       The calendar system whose date format symbols are desired.
    699 //     * @param locale    The ulocale whose symbols are desired.
    700 //     *
    701 //     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
    702 //     * @stable ICU 3.2
    703 //     */
    704 //    public DateFormatSymbols(Calendar cal, ULocale locale) {
    705 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    706 //    }
    707 
    708 //    /**
    709 //     * Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class
    710 //     * instead of a Calandar instance.
    711 //     * @see #DateFormatSymbols(Calendar, Locale)
    712 //     * @stable ICU 2.2
    713 //     */
    714 //    public DateFormatSymbols(Class<? extends Calendar> calendarClass, Locale locale) {
    715 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    716 //    }
    717 
    718 //    /**
    719 //     * Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class
    720 //     * instead of a Calandar instance.
    721 //     * @see #DateFormatSymbols(Calendar, Locale)
    722 //     * @stable ICU 3.2
    723 //     */
    724 //    public DateFormatSymbols(Class<? extends Calendar> calendarClass, ULocale locale) {
    725 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    726 //    }
    727 
    728 //    /**
    729 //     * Fetches a custom calendar's DateFormatSymbols out of the given resource
    730 //     * bundle.  Symbols that are not overridden are inherited from the
    731 //     * default DateFormatSymbols for the locale.
    732 //     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
    733 //     * @stable ICU 2.0
    734 //     */
    735 //    public DateFormatSymbols(ResourceBundle bundle, Locale locale) {
    736 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    737 //    }
    738 
    739 //    /**
    740 //     * Fetches a custom calendar's DateFormatSymbols out of the given resource
    741 //     * bundle.  Symbols that are not overridden are inherited from the
    742 //     * default DateFormatSymbols for the locale.
    743 //     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
    744 //     * @stable ICU 3.2
    745 //     */
    746 //    public DateFormatSymbols(ResourceBundle bundle, ULocale locale) {
    747 //        throw new UnsupportedOperationException("Constructor not supported by com.ibm.icu.base");
    748 //    }
    749 
    750 //    /**
    751 //     * Finds the ResourceBundle containing the date format information for
    752 //     * a specified calendar subclass in a given locale.
    753 //     * <p>
    754 //     * The resource bundle name is based on the calendar's fully-specified
    755 //     * class name, with ".resources" inserted at the end of the package name
    756 //     * (just before the class name) and "Symbols" appended to the end.
    757 //     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
    758 //     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
    759 //     * <p>
    760 //     * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
    761 //     * this API no longer works as described.  This method always returns null.
    762 //     * @deprecated ICU 4.0
    763 //     */
    764 //    // This API was formerly @stable ICU 2.0
    765 //    static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
    766 //                                                     Locale locale) throws MissingResourceException {
    767 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    768 //    }
    769 
    770 //    /**
    771 //     * Finds the ResourceBundle containing the date format information for
    772 //     * a specified calendar subclass in a given locale.
    773 //     * <p>
    774 //     * The resource bundle name is based on the calendar's fully-specified
    775 //     * class name, with ".resources" inserted at the end of the package name
    776 //     * (just before the class name) and "Symbols" appended to the end.
    777 //     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
    778 //     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
    779 //     * <p>
    780 //     * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
    781 //     * this API no longer works as described.  This method always returns null.
    782 //     * @deprecated ICU 4.0
    783 //     */
    784 //    // This API was formerly @stable ICU 3.2
    785 //    static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass,
    786 //                                                     ULocale locale) throws MissingResourceException {
    787 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    788 //    }
    789 
    790 //    /**
    791 //     * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
    792 //     * a Calendar instance instead of a Calendar class.
    793 //     * <p>
    794 //     * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
    795 //     * this API no longer works as described.  This method always returns null.
    796 //     * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
    797 //     * @deprecated ICU 4.0
    798 //     */
    799 //    // This API was formerly @stable ICU 2.2
    800 //    public static ResourceBundle getDateFormatBundle(Calendar cal, Locale locale) throws MissingResourceException {
    801 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    802 //    }
    803 
    804 //    /**
    805 //     * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
    806 //     * a Calendar instance instead of a Calendar class.
    807 //     * <p>
    808 //     * <b>Note:</b>Because of the structural changes in the ICU locale bundle,
    809 //     * this API no longer works as described.  This method always returns null.
    810 //     * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
    811 //     * @deprecated ICU 4.0
    812 //     */
    813 //    // This API was formerly @stable ICU 3.2
    814 //    public static ResourceBundle getDateFormatBundle(Calendar cal, ULocale locale) throws MissingResourceException {
    815 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    816 //    }
    817 
    818 //    /**
    819 //     * Returns the locale that was used to create this object, or null.
    820 //     * This may may differ from the locale requested at the time of
    821 //     * this object's creation.  For example, if an object is created
    822 //     * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be
    823 //     * drawn from <tt>en</tt> (the <i>actual</i> locale), and
    824 //     * <tt>en_US</tt> may be the most specific locale that exists (the
    825 //     * <i>valid</i> locale).
    826 //     *
    827 //     * <p>Note: This method will be implemented in ICU 3.0; ICU 2.8
    828 //     * contains a partial preview implementation.  The * <i>actual</i>
    829 //     * locale is returned correctly, but the <i>valid</i> locale is
    830 //     * not, in most cases.
    831 //     * @param type type of information requested, either {@link
    832 //     * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link
    833 //     * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}.
    834 //     * @return the information specified by <i>type</i>, or null if
    835 //     * this object was not constructed from locale data.
    836 //     * @see com.ibm.icu.util.ULocale
    837 //     * @see com.ibm.icu.util.ULocale#VALID_LOCALE
    838 //     * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
    839 //     * @draft ICU 2.8 (retain)
    840 //     * @provisional This API might change or be removed in a future release.
    841 //     */
    842 //    public final ULocale getLocale(ULocale.Type type) {
    843 //        throw new UnsupportedOperationException("Method not supported by com.ibm.icu.base");
    844 //    }
    845 }
    846