jdk/src/share/classes/java/text/DateFormatSymbols.java
author sherman
Tue, 30 Aug 2011 11:53:11 -0700
changeset 10419 12c063b39232
parent 7003 7d8d9506b4ee
child 12549 db2c42dabfa4
permissions -rw-r--r--
7084245: Update usages of InternalError to use exception chaining Summary: to use new InternalError constructor with cause chainning Reviewed-by: alanb, ksrini, xuelei, neugens Contributed-by: sebastian.sickelmann@gmx.de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
6491
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
     2
 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * (C) Copyright Taligent, Inc. 1996 - All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * (C) Copyright IBM Corp. 1996 - All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *   The original version of this source code and documentation is copyrighted
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * materials are provided under terms of a License Agreement between Taligent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * and Sun. This technology is protected by multiple US and International
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * patents. This notice and attribution to Taligent may not be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *   Taligent is a registered trademark of Taligent, Inc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
package java.text;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.lang.ref.SoftReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.text.spi.DateFormatSymbolsProvider;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import java.util.Arrays;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import java.util.Locale;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import java.util.ResourceBundle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
import java.util.TimeZone;
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
    51
import java.util.concurrent.ConcurrentHashMap;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
    52
import java.util.concurrent.ConcurrentMap;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
import java.util.spi.LocaleServiceProvider;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
import sun.util.LocaleServiceProviderPool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
import sun.util.TimeZoneNameUtility;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
import sun.util.calendar.ZoneInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
import sun.util.resources.LocaleData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <code>DateFormatSymbols</code> is a public class for encapsulating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * localizable date-time formatting data, such as the names of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * months, the names of the days of the week, and the time zone data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <code>DateFormat</code> and <code>SimpleDateFormat</code> both use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * <code>DateFormatSymbols</code> to encapsulate this information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * Typically you shouldn't use <code>DateFormatSymbols</code> directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * Rather, you are encouraged to create a date-time formatter with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * <code>DateFormat</code> class's factory methods: <code>getTimeInstance</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <code>getDateInstance</code>, or <code>getDateTimeInstance</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * These methods automatically create a <code>DateFormatSymbols</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * the formatter so that you don't have to. After the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * formatter is created, you may modify its format pattern using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * <code>setPattern</code> method. For more information about
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * creating formatters using <code>DateFormat</code>'s factory methods,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * see {@link DateFormat}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * If you decide to create a date-time formatter with a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * format pattern for a specific locale, you can do so with:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * new SimpleDateFormat(aPattern, DateFormatSymbols.getInstance(aLocale)).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * <code>DateFormatSymbols</code> objects are cloneable. When you obtain
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * a <code>DateFormatSymbols</code> object, feel free to modify the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * date-time formatting data. For instance, you can replace the localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * date-time format pattern characters with the ones that you feel easy
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * to remember. Or you can change the representative cities
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * to your favorite ones.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * New <code>DateFormatSymbols</code> subclasses may be added to support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * <code>SimpleDateFormat</code> for date-time formatting for additional locales.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * @see          DateFormat
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * @see          SimpleDateFormat
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * @see          java.util.SimpleTimeZone
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * @author       Chen-Lieh Huang
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
public class DateFormatSymbols implements Serializable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Construct a DateFormatSymbols object by loading format data from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * resources for the default locale. This constructor can only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * construct instances for the locales supported by the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * runtime environment, not for those supported by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * implementations. For full locale coverage, use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * {@link #getInstance(Locale) getInstance} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * @see #getInstance()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @exception  java.util.MissingResourceException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *             if the resources for the default locale cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *             found or cannot be loaded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    public DateFormatSymbols()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    {
6489
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   122
        initializeData(Locale.getDefault(Locale.Category.FORMAT));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Construct a DateFormatSymbols object by loading format data from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * resources for the given locale. This constructor can only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * construct instances for the locales supported by the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * runtime environment, not for those supported by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * implementations. For full locale coverage, use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * {@link #getInstance(Locale) getInstance} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @see #getInstance(Locale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @exception  java.util.MissingResourceException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *             if the resources for the specified locale cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *             found or cannot be loaded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    public DateFormatSymbols(Locale locale)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        initializeData(locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * Era strings. For example: "AD" and "BC".  An array of 2 strings,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    String eras[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * Month strings. For example: "January", "February", etc.  An array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * of 13 strings (some calendars have 13 months), indexed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    String months[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * Short month strings. For example: "Jan", "Feb", etc.  An array of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * 13 strings (some calendars have 13 months), indexed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    String shortMonths[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Weekday strings. For example: "Sunday", "Monday", etc.  An array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * <code>Calendar.MONDAY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * The element <code>weekdays[0]</code> is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    String weekdays[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Short weekday strings. For example: "Sun", "Mon", etc.  An array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * <code>Calendar.MONDAY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * The element <code>shortWeekdays[0]</code> is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    String shortWeekdays[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * AM and PM strings. For example: "AM" and "PM".  An array of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * 2 strings, indexed by <code>Calendar.AM</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * <code>Calendar.PM</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    String ampms[] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Localized names of time zones in this locale.  This is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * entry containing the localized names for a single <code>TimeZone</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Each such row contains (with <code>i</code> ranging from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * 0..<em>n</em>-1):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * <li><code>zoneStrings[i][2]</code> - short name of zone in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * standard time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * The zone ID is <em>not</em> localized; it's one of the valid IDs of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * the {@link java.util.TimeZone TimeZone} class that are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * <a href="../java/util/TimeZone.html#CustomID">custom IDs</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * All other entries are localized names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @see java.util.TimeZone
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    String zoneStrings[][] = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Indicates that zoneStrings is set externally with setZoneStrings() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    transient boolean isZoneStringsSet = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * Unlocalized date-time pattern characters. For example: 'y', 'd', etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * All locales use the same these unlocalized pattern characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     */
6497
22752a2b3413 4919632: RFE: SimpleDateFormat should fully support ISO8601 standard for timezone
okutsu
parents: 6491
diff changeset
   230
    static final String  patternChars = "GyMdkHmsSEDFwWahKzZYuX";
6491
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   231
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   232
    static final int PATTERN_ERA                  =  0; // G
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   233
    static final int PATTERN_YEAR                 =  1; // y
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   234
    static final int PATTERN_MONTH                =  2; // M
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   235
    static final int PATTERN_DAY_OF_MONTH         =  3; // d
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   236
    static final int PATTERN_HOUR_OF_DAY1         =  4; // k
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   237
    static final int PATTERN_HOUR_OF_DAY0         =  5; // H
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   238
    static final int PATTERN_MINUTE               =  6; // m
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   239
    static final int PATTERN_SECOND               =  7; // s
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   240
    static final int PATTERN_MILLISECOND          =  8; // S
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   241
    static final int PATTERN_DAY_OF_WEEK          =  9; // E
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   242
    static final int PATTERN_DAY_OF_YEAR          = 10; // D
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   243
    static final int PATTERN_DAY_OF_WEEK_IN_MONTH = 11; // F
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   244
    static final int PATTERN_WEEK_OF_YEAR         = 12; // w
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   245
    static final int PATTERN_WEEK_OF_MONTH        = 13; // W
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   246
    static final int PATTERN_AM_PM                = 14; // a
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   247
    static final int PATTERN_HOUR1                = 15; // h
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   248
    static final int PATTERN_HOUR0                = 16; // K
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   249
    static final int PATTERN_ZONE_NAME            = 17; // z
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   250
    static final int PATTERN_ZONE_VALUE           = 18; // Z
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   251
    static final int PATTERN_WEEK_YEAR            = 19; // Y
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   252
    static final int PATTERN_ISO_DAY_OF_WEEK      = 20; // u
6497
22752a2b3413 4919632: RFE: SimpleDateFormat should fully support ISO8601 standard for timezone
okutsu
parents: 6491
diff changeset
   253
    static final int PATTERN_ISO_ZONE             = 21; // X
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * Localized date-time pattern characters. For example, a locale may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * wish to use 'u' rather than 'y' to represent years in its date format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * pattern strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * This string must be exactly 18 characters long, with the index of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * the characters described by <code>DateFormat.ERA_FIELD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * <code>DateFormat.YEAR_FIELD</code>, etc.  Thus, if the string were
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * "Xz...", then localized patterns would use 'X' for era and 'z' for year.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    String  localPatternChars = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * The locale which is used for initializing this DateFormatSymbols object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    Locale locale = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    /* use serialVersionUID from JDK 1.1.4 for interoperability */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    static final long serialVersionUID = -5987973545549424702L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * Returns an array of all locales for which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * <code>getInstance</code> methods of this class can return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * localized instances.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * The returned array represents the union of locales supported by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * Java runtime and by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * implementations.  It must contain at least a <code>Locale</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * instance equal to {@link java.util.Locale#US Locale.US}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * @return An array of locales for which localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *         <code>DateFormatSymbols</code> instances are available.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public static Locale[] getAvailableLocales() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        LocaleServiceProviderPool pool=
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
            LocaleServiceProviderPool.getPool(DateFormatSymbolsProvider.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        return pool.getAvailableLocales();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * Gets the <code>DateFormatSymbols</code> instance for the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * locale.  This method provides access to <code>DateFormatSymbols</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * instances for locales supported by the Java runtime itself as well
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * as for those supported by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * @return a <code>DateFormatSymbols</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    public static final DateFormatSymbols getInstance() {
6489
9e7015635425 4700857: RFE: separating user locale and user interface locale
naoto
parents: 5506
diff changeset
   309
        return getInstance(Locale.getDefault(Locale.Category.FORMAT));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * Gets the <code>DateFormatSymbols</code> instance for the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * locale.  This method provides access to <code>DateFormatSymbols</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * instances for locales supported by the Java runtime itself as well
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * as for those supported by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * @param locale the given locale.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @return a <code>DateFormatSymbols</code> instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @exception NullPointerException if <code>locale</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    public static final DateFormatSymbols getInstance(Locale locale) {
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   325
        DateFormatSymbols dfs = getProviderInstance(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   326
        if (dfs != null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   327
            return dfs;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   328
        }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   329
        return (DateFormatSymbols) getCachedInstance(locale).clone();
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   330
    }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   331
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   332
    /**
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   333
     * Returns a DateFormatSymbols provided by a provider or found in
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   334
     * the cache. Note that this method returns a cached instance,
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   335
     * not its clone. Therefore, the instance should never be given to
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   336
     * an application.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   337
     */
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   338
    static final DateFormatSymbols getInstanceRef(Locale locale) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   339
        DateFormatSymbols dfs = getProviderInstance(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   340
        if (dfs != null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   341
            return dfs;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   342
        }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   343
        return getCachedInstance(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   344
    }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   345
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   346
    private static DateFormatSymbols getProviderInstance(Locale locale) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   347
        DateFormatSymbols providersInstance = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        // Check whether a provider can provide an implementation that's closer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        // to the requested locale than what the Java runtime itself can provide.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        LocaleServiceProviderPool pool =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
            LocaleServiceProviderPool.getPool(DateFormatSymbolsProvider.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        if (pool.hasProviders()) {
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   354
            providersInstance = pool.getLocalizedObject(
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   355
                                    DateFormatSymbolsGetter.INSTANCE, locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   356
        }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   357
        return providersInstance;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   358
    }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   359
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   360
    /**
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   361
     * Returns a cached DateFormatSymbols if it's found in the
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   362
     * cache. Otherwise, this method returns a newly cached instance
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   363
     * for the given locale.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   364
     */
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   365
    private static DateFormatSymbols getCachedInstance(Locale locale) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   366
        SoftReference<DateFormatSymbols> ref = cachedInstances.get(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   367
        DateFormatSymbols dfs = null;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   368
        if (ref == null || (dfs = ref.get()) == null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   369
            dfs = new DateFormatSymbols(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   370
            ref = new SoftReference<DateFormatSymbols>(dfs);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   371
            SoftReference<DateFormatSymbols> x = cachedInstances.putIfAbsent(locale, ref);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   372
            if (x != null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   373
                DateFormatSymbols y = x.get();
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   374
                if (y != null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   375
                    dfs = y;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   376
                } else {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   377
                    // Replace the empty SoftReference with ref.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   378
                    cachedInstances.put(locale, ref);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   379
                }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
        }
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   382
        return dfs;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * Gets era strings. For example: "AD" and "BC".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * @return the era strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    public String[] getEras() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        return Arrays.copyOf(eras, eras.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * Sets era strings. For example: "AD" and "BC".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * @param newEras the new era strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    public void setEras(String[] newEras) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        eras = Arrays.copyOf(newEras, newEras.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * Gets month strings. For example: "January", "February", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @return the month strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    public String[] getMonths() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        return Arrays.copyOf(months, months.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * Sets month strings. For example: "January", "February", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @param newMonths the new month strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    public void setMonths(String[] newMonths) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
        months = Arrays.copyOf(newMonths, newMonths.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * Gets short month strings. For example: "Jan", "Feb", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * @return the short month strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    public String[] getShortMonths() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
        return Arrays.copyOf(shortMonths, shortMonths.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * Sets short month strings. For example: "Jan", "Feb", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @param newShortMonths the new short month strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    public void setShortMonths(String[] newShortMonths) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * Gets weekday strings. For example: "Sunday", "Monday", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * @return the weekday strings. Use <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * <code>Calendar.MONDAY</code>, etc. to index the result array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    public String[] getWeekdays() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        return Arrays.copyOf(weekdays, weekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * Sets weekday strings. For example: "Sunday", "Monday", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @param newWeekdays the new weekday strings. The array should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * be indexed by <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * <code>Calendar.MONDAY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    public void setWeekdays(String[] newWeekdays) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        weekdays = Arrays.copyOf(newWeekdays, newWeekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * Gets short weekday strings. For example: "Sun", "Mon", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * @return the short weekday strings. Use <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * <code>Calendar.MONDAY</code>, etc. to index the result array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    public String[] getShortWeekdays() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
        return Arrays.copyOf(shortWeekdays, shortWeekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * Sets short weekday strings. For example: "Sun", "Mon", etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @param newShortWeekdays the new short weekday strings. The array should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * be indexed by <code>Calendar.SUNDAY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * <code>Calendar.MONDAY</code>, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
    public void setShortWeekdays(String[] newShortWeekdays) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
        shortWeekdays = Arrays.copyOf(newShortWeekdays, newShortWeekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * Gets ampm strings. For example: "AM" and "PM".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * @return the ampm strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    public String[] getAmPmStrings() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        return Arrays.copyOf(ampms, ampms.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * Sets ampm strings. For example: "AM" and "PM".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @param newAmpms the new ampm strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    public void setAmPmStrings(String[] newAmpms) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
        ampms = Arrays.copyOf(newAmpms, newAmpms.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * Gets time zone strings.  Use of this method is discouraged; use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * {@link java.util.TimeZone#getDisplayName() TimeZone.getDisplayName()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * The value returned is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * entry containing the localized names for a single <code>TimeZone</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * Each such row contains (with <code>i</code> ranging from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * 0..<em>n</em>-1):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * <li><code>zoneStrings[i][2]</code> - short name of zone in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * standard time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * The zone ID is <em>not</em> localized; it's one of the valid IDs of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * the {@link java.util.TimeZone TimeZone} class that are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * <a href="../util/TimeZone.html#CustomID">custom IDs</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * All other entries are localized names.  If a zone does not implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * daylight saving time, the daylight saving time names should not be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * If {@link #setZoneStrings(String[][]) setZoneStrings} has been called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * on this <code>DateFormatSymbols</code> instance, then the strings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * provided by that call are returned. Otherwise, the returned array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * contains names provided by the Java runtime and by installed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * {@link java.util.spi.TimeZoneNameProvider TimeZoneNameProvider}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @return the time zone strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * @see #setZoneStrings(String[][])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
    public String[][] getZoneStrings() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
        return getZoneStringsImpl(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * Sets time zone strings.  The argument must be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * where <em>m</em> is at least 5.  Each of the <em>n</em> rows is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * entry containing the localized names for a single <code>TimeZone</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * Each such row contains (with <code>i</code> ranging from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * 0..<em>n</em>-1):
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * <li><code>zoneStrings[i][2]</code> - short name of zone in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * standard time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * saving time</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * The zone ID is <em>not</em> localized; it's one of the valid IDs of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * the {@link java.util.TimeZone TimeZone} class that are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * <a href="../util/TimeZone.html#CustomID">custom IDs</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * All other entries are localized names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * @param newZoneStrings the new time zone strings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * @exception IllegalArgumentException if the length of any row in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     *    <code>newZoneStrings</code> is less than 5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * @exception NullPointerException if <code>newZoneStrings</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * @see #getZoneStrings()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
    public void setZoneStrings(String[][] newZoneStrings) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
        String[][] aCopy = new String[newZoneStrings.length][];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
        for (int i = 0; i < newZoneStrings.length; ++i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
            int len = newZoneStrings[i].length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
            if (len < 5) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
                throw new IllegalArgumentException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
            aCopy[i] = Arrays.copyOf(newZoneStrings[i], len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
        zoneStrings = aCopy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
        isZoneStringsSet = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * Gets localized date-time pattern characters. For example: 'u', 't', etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @return the localized date-time pattern characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    public String getLocalPatternChars() {
6491
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   576
        return localPatternChars;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * Sets localized date-time pattern characters. For example: 'u', 't', etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @param newLocalPatternChars the new localized date-time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * pattern characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    public void setLocalPatternChars(String newLocalPatternChars) {
6491
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   585
        // Call toString() to throw an NPE in case the argument is null
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   586
        localPatternChars = newLocalPatternChars.toString();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * Overrides Cloneable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    public Object clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
        try
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
            DateFormatSymbols other = (DateFormatSymbols)super.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
            copyMembers(this, other);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
            return other;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
        } catch (CloneNotSupportedException e) {
10419
12c063b39232 7084245: Update usages of InternalError to use exception chaining
sherman
parents: 7003
diff changeset
   600
            throw new InternalError(e);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * Override hashCode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * Generates a hash code for the DateFormatSymbols object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
    public int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
        int hashcode = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
        String[][] zoneStrings = getZoneStringsWrapper();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
        for (int index = 0; index < zoneStrings[0].length; ++index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
            hashcode ^= zoneStrings[0][index].hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
        return hashcode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * Override equals
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
    public boolean equals(Object obj)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
        if (this == obj) return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
        if (obj == null || getClass() != obj.getClass()) return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
        DateFormatSymbols that = (DateFormatSymbols) obj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
        return (Arrays.equals(eras, that.eras)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
                && Arrays.equals(months, that.months)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
                && Arrays.equals(shortMonths, that.shortMonths)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
                && Arrays.equals(weekdays, that.weekdays)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
                && Arrays.equals(shortWeekdays, that.shortWeekdays)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                && Arrays.equals(ampms, that.ampms)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                && Arrays.deepEquals(getZoneStringsWrapper(), that.getZoneStringsWrapper())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
                && ((localPatternChars != null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
                  && localPatternChars.equals(that.localPatternChars))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
                 || (localPatternChars == null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
                  && that.localPatternChars == null)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
    // =======================privates===============================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * Useful constant for defining time zone offsets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    static final int millisPerHour = 60*60*1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
    /**
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   645
     * Cache to hold DateFormatSymbols instances per Locale.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     */
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   647
    private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> cachedInstances
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   648
        = new ConcurrentHashMap<Locale, SoftReference<DateFormatSymbols>>(3);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
    private void initializeData(Locale desiredLocale) {
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   651
        locale = desiredLocale;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   653
        // Copy values of a cached instance if any.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   654
        SoftReference<DateFormatSymbols> ref = cachedInstances.get(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   655
        DateFormatSymbols dfs;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   656
        if (ref != null && (dfs = ref.get()) != null) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   657
            copyMembers(dfs, this);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   658
            return;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   659
        }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   660
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   661
        // Initialize the fields from the ResourceBundle for locale.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   662
        ResourceBundle resource = LocaleData.getDateFormatData(locale);
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   663
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   664
        eras = resource.getStringArray("Eras");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
        months = resource.getStringArray("MonthNames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
        shortMonths = resource.getStringArray("MonthAbbreviations");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
        ampms = resource.getStringArray("AmPmMarkers");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
        localPatternChars = resource.getString("DateTimePatternChars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
7003
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   670
        // Day of week names are stored in a 1-based array.
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   671
        weekdays = toOneBasedArray(resource.getStringArray("DayNames"));
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   672
        shortWeekdays = toOneBasedArray(resource.getStringArray("DayAbbreviations"));
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   673
    }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   674
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   675
    private static String[] toOneBasedArray(String[] src) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   676
        int len = src.length;
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   677
        String[] dst = new String[len + 1];
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   678
        dst[0] = "";
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   679
        for (int i = 0; i < len; i++) {
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   680
            dst[i + 1] = src[i];
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   681
        }
7d8d9506b4ee 6991380: (cal) Calendar.cachedLocaleData should be transitioned from Hashtable to ConcurrentHashMap
okutsu
parents: 6497
diff changeset
   682
        return dst;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * Package private: used by SimpleDateFormat
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * Gets the index for the given time zone ID to obtain the time zone
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * strings for formatting. The time zone ID is just for programmatic
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * lookup. NOT LOCALIZED!!!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * @param ID the given time zone ID.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @return the index of the given time zone ID.  Returns -1 if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * the given time zone ID can't be located in the DateFormatSymbols object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * @see java.util.SimpleTimeZone
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
    final int getZoneIndex(String ID)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
        String[][] zoneStrings = getZoneStringsWrapper();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
        for (int index=0; index<zoneStrings.length; index++)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
            if (ID.equals(zoneStrings[index][0])) return index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
        return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * Wrapper method to the getZoneStrings(), which is called from inside
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * the java.text package and not to mutate the returned arrays, so that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * it does not need to create a defensive copy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
    final String[][] getZoneStringsWrapper() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
        if (isSubclassObject()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
            return getZoneStrings();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
            return getZoneStringsImpl(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
    private final String[][] getZoneStringsImpl(boolean needsCopy) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
        if (zoneStrings == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
            zoneStrings = TimeZoneNameUtility.getZoneStrings(locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
        if (!needsCopy) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
            return zoneStrings;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
        int len = zoneStrings.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
        String[][] aCopy = new String[len][];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
        for (int i = 0; i < len; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
            aCopy[i] = Arrays.copyOf(zoneStrings[i], zoneStrings[i].length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
        return aCopy;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
    private final boolean isSubclassObject() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
        return !getClass().getName().equals("java.text.DateFormatSymbols");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * Clones all the data members from the source DateFormatSymbols to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * the target DateFormatSymbols. This is only for subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * @param src the source DateFormatSymbols.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * @param dst the target DateFormatSymbols.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
    private final void copyMembers(DateFormatSymbols src, DateFormatSymbols dst)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
        dst.eras = Arrays.copyOf(src.eras, src.eras.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
        dst.months = Arrays.copyOf(src.months, src.months.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
        dst.shortMonths = Arrays.copyOf(src.shortMonths, src.shortMonths.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
        dst.weekdays = Arrays.copyOf(src.weekdays, src.weekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
        dst.shortWeekdays = Arrays.copyOf(src.shortWeekdays, src.shortWeekdays.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
        dst.ampms = Arrays.copyOf(src.ampms, src.ampms.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
        if (src.zoneStrings != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
            dst.zoneStrings = src.getZoneStringsImpl(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
            dst.zoneStrings = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
        }
6491
cd1bcc5057f4 4267450: (cal) API: Need public API to calculate, format and parse "year of week"
okutsu
parents: 6489
diff changeset
   759
        dst.localPatternChars = src.localPatternChars;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * Write out the default serializable data, after ensuring the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * <code>zoneStrings</code> field is initialized in order to make
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * sure the backward compatibility.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
    private void writeObject(ObjectOutputStream stream) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
        if (zoneStrings == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
            zoneStrings = TimeZoneNameUtility.getZoneStrings(locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
        stream.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * Obtains a DateFormatSymbols instance from a DateFormatSymbolsProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
    private static class DateFormatSymbolsGetter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
        implements LocaleServiceProviderPool.LocalizedObjectGetter<DateFormatSymbolsProvider,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
                                                                   DateFormatSymbols> {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
        private static final DateFormatSymbolsGetter INSTANCE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
            new DateFormatSymbolsGetter();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
        public DateFormatSymbols getObject(DateFormatSymbolsProvider dateFormatSymbolsProvider,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
                                Locale locale,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
                                String key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
                                Object... params) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
            assert params.length == 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
            return dateFormatSymbolsProvider.getInstance(locale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
}