KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > icu > text > DateFormatSymbols


1 /*
2  *******************************************************************************
3  * Copyright (C) 1996-2007, International Business Machines Corporation and *
4  * others. All Rights Reserved. *
5  *******************************************************************************
6  */

7
8 package com.ibm.icu.text;
9
10 import java.io.Serializable JavaDoc;
11 import java.util.ArrayList JavaDoc;
12 import java.util.HashMap JavaDoc;
13 import java.util.HashSet JavaDoc;
14 import java.util.Locale JavaDoc;
15 import java.util.MissingResourceException JavaDoc;
16 import java.util.ResourceBundle JavaDoc;
17
18 import com.ibm.icu.impl.CalendarData;
19 import com.ibm.icu.impl.ICUCache;
20 import com.ibm.icu.impl.ICUResourceBundle;
21 import com.ibm.icu.impl.SimpleCache;
22 import com.ibm.icu.impl.TextTrieMap;
23 import com.ibm.icu.impl.Utility;
24 import com.ibm.icu.impl.ZoneMeta;
25 import com.ibm.icu.util.Calendar;
26 import com.ibm.icu.util.GregorianCalendar;
27 import com.ibm.icu.util.TimeZone;
28 import com.ibm.icu.util.ULocale;
29 import com.ibm.icu.util.UResourceBundle;
30
31 /**
32  * <code>DateFormatSymbols</code> is a public class for encapsulating
33  * localizable date-time formatting data, such as the names of the
34  * months, the names of the days of the week, and the time zone data.
35  * <code>DateFormat</code> and <code>SimpleDateFormat</code> both use
36  * <code>DateFormatSymbols</code> to encapsulate this information.
37  *
38  * <p>
39  * Typically you shouldn't use <code>DateFormatSymbols</code> directly.
40  * Rather, you are encouraged to create a date-time formatter with the
41  * <code>DateFormat</code> class's factory methods: <code>getTimeInstance</code>,
42  * <code>getDateInstance</code>, or <code>getDateTimeInstance</code>.
43  * These methods automatically create a <code>DateFormatSymbols</code> for
44  * the formatter so that you don't have to. After the
45  * formatter is created, you may modify its format pattern using the
46  * <code>setPattern</code> method. For more information about
47  * creating formatters using <code>DateFormat</code>'s factory methods,
48  * see {@link DateFormat}.
49  *
50  * <p>
51  * If you decide to create a date-time formatter with a specific
52  * format pattern for a specific locale, you can do so with:
53  * <blockquote>
54  * <pre>
55  * new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
56  * </pre>
57  * </blockquote>
58  *
59  * <p>
60  * <code>DateFormatSymbols</code> objects are clonable. When you obtain
61  * a <code>DateFormatSymbols</code> object, feel free to modify the
62  * date-time formatting data. For instance, you can replace the localized
63  * date-time format pattern characters with the ones that you feel easy
64  * to remember. Or you can change the representative cities
65  * to your favorite ones.
66  *
67  * <p>
68  * New <code>DateFormatSymbols</code> subclasses may be added to support
69  * <code>SimpleDateFormat</code> for date-time formatting for additional locales.
70
71  * @see DateFormat
72  * @see SimpleDateFormat
73  * @see com.ibm.icu.util.SimpleTimeZone
74  * @author Chen-Lieh Huang
75  * @stable ICU 2.0
76  */

77 public class DateFormatSymbols implements Serializable JavaDoc, Cloneable JavaDoc {
78
79     // TODO make sure local pattern char string is 18 characters long,
80
// that is, that it encompasses the new 'u' char for
81
// EXTENDED_YEAR. Two options: 1. Make sure resource data is
82
// correct; 2. Make code add in 'u' at end if len == 17.
83

84     // Constants for context
85
/**
86      * Constant for context.
87      * @draft ICU 3.6
88      * @provisional This API might change or be removed in a future release.
89      */

90     public static final int FORMAT = 0;
91
92     /**
93      * Constant for context.
94      * @draft ICU 3.6
95      * @provisional This API might change or be removed in a future release.
96      */

97     public static final int STANDALONE = 1;
98
99     /**
100      * Constant for context.
101      * @internal revisit for ICU 3.6
102      * @deprecated This API is ICU internal only.
103      */

104     public static final int DT_CONTEXT_COUNT = 2;
105
106     // Constants for width
107

108     /**
109      * Constant for width.
110      * @draft ICU 3.6
111      * @provisional This API might change or be removed in a future release.
112      */

113     public static final int ABBREVIATED = 0;
114
115     /**
116      * Constant for width.
117      * @draft ICU 3.6
118      * @provisional This API might change or be removed in a future release.
119      */

120     public static final int WIDE = 1;
121
122     /**
123      * Constant for width.
124      * @draft ICU 3.6
125      * @provisional This API might change or be removed in a future release.
126      */

127     public static final int NARROW = 2;
128
129     /**
130      * Constant for width.
131      * @internal revisit for ICU 3.6
132      * @deprecated This API is ICU internal only.
133      */

134     public static final int DT_WIDTH_COUNT = 3;
135
136     /**
137      * Construct a DateFormatSymbols object by loading format data from
138      * resources for the default locale.
139      *
140      * @throws java.util.MissingResourceException
141      * if the resources for the default locale cannot be
142      * found or cannot be loaded.
143      * @stable ICU 2.0
144      */

145     public DateFormatSymbols()
146     {
147         initializeData(ULocale.getDefault(), ""); // TODO: type?
148
}
149     
150     /**
151      * Construct a DateFormatSymbols object by loading format data from
152      * resources for the given locale.
153      *
154      * @throws java.util.MissingResourceException
155      * if the resources for the specified locale cannot be
156      * found or cannot be loaded.
157      * @stable ICU 2.0
158      */

159     public DateFormatSymbols(Locale JavaDoc locale)
160     {
161         initializeData(ULocale.forLocale(locale), ""); // TODO: type?
162
}
163
164     /**
165      * Construct a DateFormatSymbols object by loading format data from
166      * resources for the given ulocale.
167      *
168      * @throws java.util.MissingResourceException
169      * if the resources for the specified locale cannot be
170      * found or cannot be loaded.
171      * @draft ICU 3.2
172      * @provisional This API might change or be removed in a future release.
173      */

174     public DateFormatSymbols(ULocale locale)
175     {
176         initializeData(locale, ""); // TODO: type?
177
}
178
179     /**
180      * Era strings. For example: "AD" and "BC". An array of 2 strings,
181      * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
182      * @serial
183      */

184     String JavaDoc eras[] = null;
185
186     /**
187      * Era name strings. For example: "Anno Domini" and "Before Christ". An array of 2 strings,
188      * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
189      * @serial
190      */

191     String JavaDoc eraNames[] = null;
192     
193     /**
194      * Narrow era names. For example: "A" and "B". An array of 2 strings,
195      * indexed by <code>Calendar.BC</code> and <code>Calendar.AD</code>.
196      * @serial
197      */

198     String JavaDoc narrowEras[] = null;
199
200     /**
201      * Month strings. For example: "January", "February", etc. An array
202      * of 13 strings (some calendars have 13 months), indexed by
203      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
204      * @serial
205      */

206     String JavaDoc months[] = null;
207
208     /**
209      * Short month strings. For example: "Jan", "Feb", etc. An array of
210      * 13 strings (some calendars have 13 months), indexed by
211      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
212
213      * @serial
214      */

215     String JavaDoc shortMonths[] = null;
216
217     /**
218      * Narrow month strings. For example: "J", "F", etc. An array of
219      * 13 strings (some calendars have 13 months), indexed by
220      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
221
222      * @serial
223      */

224     String JavaDoc narrowMonths[] = null;
225
226     /**
227      * Standalone month strings. For example: "January", "February", etc. An array
228      * of 13 strings (some calendars have 13 months), indexed by
229      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
230      * @serial
231      */

232     String JavaDoc standaloneMonths[] = null;
233
234     /**
235      * Standalone short month strings. For example: "Jan", "Feb", etc. An array of
236      * 13 strings (some calendars have 13 months), indexed by
237      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
238
239      * @serial
240      */

241     String JavaDoc standaloneShortMonths[] = null;
242
243     /**
244      * Standalone narrow month strings. For example: "J", "F", etc. An array of
245      * 13 strings (some calendars have 13 months), indexed by
246      * <code>Calendar.JANUARY</code>, <code>Calendar.FEBRUARY</code>, etc.
247
248      * @serial
249      */

250     String JavaDoc standaloneNarrowMonths[] = null;
251
252     /**
253      * Weekday strings. For example: "Sunday", "Monday", etc. An array
254      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
255      * <code>Calendar.MONDAY</code>, etc.
256      * The element <code>weekdays[0]</code> is ignored.
257      * @serial
258      */

259     String JavaDoc weekdays[] = null;
260
261     /**
262      * Short weekday strings. For example: "Sun", "Mon", etc. An array
263      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
264      * <code>Calendar.MONDAY</code>, etc.
265      * The element <code>shortWeekdays[0]</code> is ignored.
266      * @serial
267      */

268     String JavaDoc shortWeekdays[] = null;
269
270     /**
271      * Narrow weekday strings. For example: "S", "M", etc. An array
272      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
273      * <code>Calendar.MONDAY</code>, etc.
274      * The element <code>narrowWeekdays[0]</code> is ignored.
275      * @serial
276      */

277     String JavaDoc narrowWeekdays[] = null;
278
279     /**
280      * Standalone weekday strings. For example: "Sunday", "Monday", etc. An array
281      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
282      * <code>Calendar.MONDAY</code>, etc.
283      * The element <code>standaloneWeekdays[0]</code> is ignored.
284      * @serial
285      */

286     String JavaDoc standaloneWeekdays[] = null;
287
288     /**
289      * Standalone short weekday strings. For example: "Sun", "Mon", etc. An array
290      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
291      * <code>Calendar.MONDAY</code>, etc.
292      * The element <code>standaloneShortWeekdays[0]</code> is ignored.
293      * @serial
294      */

295     String JavaDoc standaloneShortWeekdays[] = null;
296
297     /**
298      * Standalone narrow weekday strings. For example: "S", "M", etc. An array
299      * of 8 strings, indexed by <code>Calendar.SUNDAY</code>,
300      * <code>Calendar.MONDAY</code>, etc.
301      * The element <code>standaloneNarrowWeekdays[0]</code> is ignored.
302      * @serial
303      */

304     String JavaDoc standaloneNarrowWeekdays[] = null;
305
306     /**
307      * AM and PM strings. For example: "AM" and "PM". An array of
308      * 2 strings, indexed by <code>Calendar.AM</code> and
309      * <code>Calendar.PM</code>.
310      * @serial
311      */

312     String JavaDoc ampms[] = null;
313     
314     /**
315      * Abbreviated quarter names. For example: "Q1", "Q2", "Q3", "Q4". An array
316      * of 4 strings indexed by the month divided by 3.
317      * @serial
318      */

319     String JavaDoc shortQuarters[] = null;
320     
321     /**
322      * Full quarter names. For example: "1st Quarter", "2nd Quarter", "3rd Quarter",
323      * "4th Quarter". An array of 4 strings, indexed by the month divided by 3.
324      * @serial
325      */

326     String JavaDoc quarters[] = null;
327     
328     /**
329      * Standalone abbreviated quarter names. For example: "Q1", "Q2", "Q3", "Q4". An array
330      * of 4 strings indexed by the month divided by 3.
331      * @serial
332      */

333     String JavaDoc standaloneShortQuarters[] = null;
334     
335     /**
336      * Standalone full quarter names. For example: "1st Quarter", "2nd Quarter", "3rd Quarter",
337      * "4th Quarter". An array of 4 strings, indexed by the month divided by 3.
338      * @serial
339      */

340     String JavaDoc standaloneQuarters[] = null;
341
342     /**
343      * Localized names of time zones in this locale. This is a
344      * two-dimensional array of strings of size <em>n</em> by <em>m</em>,
345      * where <em>m</em> is at least 5 and up to 8. Each of the <em>n</em> rows is an
346      * entry containing the localized names for a single <code>TimeZone</code>.
347      * Each such row contains (with <code>i</code> ranging from
348      * 0..<em>n</em>-1):
349      * <ul>
350      * <li><code>zoneStrings[i][0]</code> - time zone ID</li>
351      * <li><code>zoneStrings[i][1]</code> - long name of zone in standard
352      * time</li>
353      * <li><code>zoneStrings[i][2]</code> - short name of zone in
354      * standard time</li>
355      * <li><code>zoneStrings[i][3]</code> - long name of zone in daylight
356      * savings time</li>
357      * <li><code>zoneStrings[i][4]</code> - short name of zone in daylight
358      * savings time</li>
359      * <li>The remainder varies depending on whether there is data
360      * on city name or generic time. The city name, if available, comes
361      * first. The long and short generic times, if available, come next,
362      * in that order. The length of the array (m) can be examined to
363      * determine which optional information is available.</li>
364      * </ul>
365      * The zone ID is <em>not</em> localized; it corresponds to the ID
366      * value associated with a system time zone object. All other entries
367      * are localized names. If a zone does not implement daylight savings
368      * time, the daylight savings time names are ignored.
369      * @see com.ibm.icu.util.TimeZone
370      * @serial
371      */

372      private String JavaDoc zoneStrings[][] = null;
373
374     /**
375      * Unlocalized date-time pattern characters. For example: 'y', 'd', etc.
376      * All locales use the same unlocalized pattern characters.
377      */

378     static final String JavaDoc patternChars = "GyMdkHmsSEDFwWahKzYeugAZvcLQq";
379
380     /**
381      * Localized date-time pattern characters. For example, a locale may
382      * wish to use 'u' rather than 'y' to represent years in its date format
383      * pattern strings.
384      * This string must be exactly 18 characters long, with the index of
385      * the characters described by <code>DateFormat.ERA_FIELD</code>,
386      * <code>DateFormat.YEAR_FIELD</code>, etc. Thus, if the string were
387      * "Xz...", then localized patterns would use 'X' for era and 'z' for year.
388      * @serial
389      */

390     String JavaDoc localPatternChars = null;
391
392     /* use serialVersionUID from JDK 1.1.4 for interoperability */
393     private static final long serialVersionUID = -5987973545549424702L;
394
395     /**
396      * Gets era strings. For example: "AD" and "BC".
397      * @return the era strings.
398      * @stable ICU 2.0
399      */

400     public String JavaDoc[] getEras() {
401         return duplicate(eras);
402     }
403
404     /**
405      * Sets era strings. For example: "AD" and "BC".
406      * @param newEras the new era strings.
407      * @stable ICU 2.0
408      */

409     public void setEras(String JavaDoc[] newEras) {
410         eras = duplicate(newEras);
411     }
412
413     /**
414      * Gets era name strings. For example: "Anno Domini" and "Before Christ".
415      * @return the era strings.
416      * @draft ICU 3.4
417      * @provisional This API might change or be removed in a future release.
418      */

419     public String JavaDoc[] getEraNames() {
420         return duplicate(eraNames);
421     }
422
423     /**
424      * Sets era name strings. For example: "Anno Domini" and "Before Christ".
425      * @param newEraNames the new era strings.
426      * @internal revisit for ICU 3.6
427      * @deprecated This API is ICU internal only.
428      */

429     public void setEraNames(String JavaDoc[] newEraNames) {
430         eraNames = duplicate(newEraNames);
431     }
432
433     /**
434      * Gets month strings. For example: "January", "February", etc.
435      * @return the month strings.
436      * @stable ICU 2.0
437      */

438     public String JavaDoc[] getMonths() {
439         return duplicate(months);
440     }
441
442     /**
443      * Gets month strings. For example: "January", "February", etc.
444      * @param context The month context, FORMAT or STANDALONE.
445      * @param width The width or the returned month string,
446      * either WIDE, ABBREVIATED, or NARROW.
447      * @return the month strings.
448      * @draft ICU 3.4
449      * @provisional This API might change or be removed in a future release.
450      */

451     public String JavaDoc[] getMonths(int context, int width) {
452         String JavaDoc [] returnValue = null;
453         switch (context) {
454            case FORMAT :
455               switch(width) {
456                  case WIDE :
457                     returnValue = months;
458                     break;
459                  case ABBREVIATED :
460                     returnValue = shortMonths;
461                     break;
462                  case NARROW :
463                     returnValue = narrowMonths;
464                     break;
465               }
466               break;
467            case STANDALONE :
468               switch(width) {
469                  case WIDE :
470                     returnValue = standaloneMonths;
471                     break;
472                  case ABBREVIATED :
473                     returnValue = standaloneShortMonths;
474                     break;
475                  case NARROW :
476                     returnValue = standaloneNarrowMonths;
477                     break;
478               }
479               break;
480         }
481         return duplicate(returnValue);
482     }
483
484     /**
485      * Sets month strings. For example: "January", "February", etc.
486      * @param newMonths the new month strings.
487      * @stable ICU 2.0
488      */

489     public void setMonths(String JavaDoc[] newMonths) {
490         months = duplicate(newMonths);
491     }
492
493     /**
494      * Sets month strings. For example: "January", "February", etc.
495      * @param newMonths the new month strings.
496      * @param context The formatting context, FORMAT or STANDALONE.
497      * @param width The width of the month string,
498      * either WIDE, ABBREVIATED, or NARROW.
499      * @internal revisit for ICU 3.6
500      * @deprecated This API is ICU internal only.
501      */

502     public void setMonths(String JavaDoc[] newMonths, int context, int width) {
503         switch (context) {
504            case FORMAT :
505               switch(width) {
506                  case WIDE :
507                     months = duplicate(newMonths);
508                     break;
509                  case ABBREVIATED :
510                     shortMonths = duplicate(newMonths);
511                     break;
512                  case NARROW :
513                     narrowMonths = duplicate(newMonths);
514                     break;
515               }
516               break;
517            case STANDALONE :
518               switch(width) {
519                  case WIDE :
520                     standaloneMonths = duplicate(newMonths);
521                     break;
522                  case ABBREVIATED :
523                     standaloneShortMonths = duplicate(newMonths);
524                     break;
525                  case NARROW :
526                     standaloneNarrowMonths = duplicate(newMonths);
527                     break;
528               }
529               break;
530         }
531     }
532     
533     /**
534      * Gets short month strings. For example: "Jan", "Feb", etc.
535      * @return the short month strings.
536      * @stable ICU 2.0
537      */

538     public String JavaDoc[] getShortMonths() {
539         return duplicate(shortMonths);
540     }
541
542     /**
543      * Sets short month strings. For example: "Jan", "Feb", etc.
544      * @param newShortMonths the new short month strings.
545      * @stable ICU 2.0
546      */

547     public void setShortMonths(String JavaDoc[] newShortMonths) {
548         shortMonths = duplicate(newShortMonths);
549     }
550
551     /**
552      * Gets weekday strings. For example: "Sunday", "Monday", etc.
553      * @return the weekday strings. Use <code>Calendar.SUNDAY</code>,
554      * <code>Calendar.MONDAY</code>, etc. to index the result array.
555      * @stable ICU 2.0
556      */

557     public String JavaDoc[] getWeekdays() {
558         return duplicate(weekdays);
559     }
560
561     /**
562      * Gets weekday strings. For example: "Sunday", "Monday", etc.
563      * @return the weekday strings. Use <code>Calendar.SUNDAY</code>,
564      * <code>Calendar.MONDAY</code>, etc. to index the result array.
565      * @param context Formatting context, either FORMAT or STANDALONE.
566      * @param width Width of strings to be returned, either
567      * WIDE, ABBREVIATED, or NARROW
568      * @draft ICU 3.4
569      * @provisional This API might change or be removed in a future release.
570      */

571     public String JavaDoc[] getWeekdays(int context, int width) {
572         String JavaDoc [] returnValue = null;
573         switch (context) {
574            case FORMAT :
575               switch(width) {
576                  case WIDE :
577                     returnValue = weekdays;
578                     break;
579                  case ABBREVIATED :
580                     returnValue = shortWeekdays;
581                     break;
582                  case NARROW :
583                     returnValue = narrowWeekdays;
584                     break;
585               }
586               break;
587            case STANDALONE :
588               switch(width) {
589                  case WIDE :
590                     returnValue = standaloneWeekdays;
591                     break;
592                  case ABBREVIATED :
593                     returnValue = standaloneShortWeekdays;
594                     break;
595                  case NARROW :
596                     returnValue = standaloneNarrowWeekdays;
597                     break;
598               }
599               break;
600         }
601         return duplicate(returnValue);
602     }
603
604     /**
605      * Sets weekday strings. For example: "Sunday", "Monday", etc.
606      * @param newWeekdays The new weekday strings.
607      * @param context The formatting context, FORMAT or STANDALONE.
608      * @param width The width of the strings,
609      * either WIDE, ABBREVIATED, or NARROW.
610      * @internal revisit for ICU 3.6
611      * @deprecated This API is ICU internal only.
612      */

613     public void setWeekdays(String JavaDoc[] newWeekdays, int context, int width) {
614         switch (context) {
615            case FORMAT :
616               switch(width) {
617                  case WIDE :
618                     weekdays = duplicate(newWeekdays);
619                     break;
620                  case ABBREVIATED :
621                     shortWeekdays = duplicate(newWeekdays);
622                     break;
623                  case NARROW :
624                     narrowWeekdays = duplicate(newWeekdays);
625                     break;
626               }
627               break;
628            case STANDALONE :
629               switch(width) {
630                  case WIDE :
631                     standaloneWeekdays = duplicate(newWeekdays);
632                     break;
633                  case ABBREVIATED :
634                     standaloneShortWeekdays = duplicate(newWeekdays);
635                     break;
636                  case NARROW :
637                     standaloneNarrowWeekdays = duplicate(newWeekdays);
638                     break;
639               }
640               break;
641         }
642     }
643
644     /**
645      * Sets weekday strings. For example: "Sunday", "Monday", etc.
646      * @param newWeekdays the new weekday strings. The array should
647      * be indexed by <code>Calendar.SUNDAY</code>,
648      * <code>Calendar.MONDAY</code>, etc.
649      * @stable ICU 2.0
650      */

651     public void setWeekdays(String JavaDoc[] newWeekdays) {
652         weekdays = duplicate(newWeekdays);
653     }
654
655     /**
656      * Gets short weekday strings. For example: "Sun", "Mon", etc.
657      * @return the short weekday strings. Use <code>Calendar.SUNDAY</code>,
658      * <code>Calendar.MONDAY</code>, etc. to index the result array.
659      * @stable ICU 2.0
660      */

661     public String JavaDoc[] getShortWeekdays() {
662         return duplicate(shortWeekdays);
663     }
664
665     /**
666      * Sets short weekday strings. For example: "Sun", "Mon", etc.
667      * @param newShortWeekdays the new short weekday strings. The array should
668      * be indexed by <code>Calendar.SUNDAY</code>,
669      * <code>Calendar.MONDAY</code>, etc.
670      * @stable ICU 2.0
671      */

672     public void setShortWeekdays(String JavaDoc[] newShortWeekdays) {
673         shortWeekdays = duplicate(newShortWeekdays);
674     }
675     /**
676      * Gets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
677      * @param context The quarter context, FORMAT or STANDALONE.
678      * @param width The width or the returned quarter string,
679      * either WIDE or ABBREVIATED. There are no NARROW quarters.
680      * @return the quarter strings.
681      * @draft ICU 3.6
682      * @provisional This API might change or be removed in a future release.
683      */

684     public String JavaDoc[] getQuarters(int context, int width) {
685         String JavaDoc [] returnValue = null;
686         switch (context) {
687            case FORMAT :
688               switch(width) {
689                  case WIDE :
690                     returnValue = quarters;
691                     break;
692                  case ABBREVIATED :
693                     returnValue = shortQuarters;
694                     break;
695                  case NARROW :
696                      returnValue = null;
697                      break;
698               }
699               break;
700               
701            case STANDALONE :
702               switch(width) {
703                  case WIDE :
704                     returnValue = standaloneQuarters;
705                     break;
706                  case ABBREVIATED :
707                     returnValue = standaloneShortQuarters;
708                     break;
709                  case NARROW:
710                      returnValue = null;
711                      break;
712               }
713               break;
714         }
715         return duplicate(returnValue);
716     }
717
718     /**
719      * Sets quarter strings. For example: "1st Quarter", "2nd Quarter", etc.
720      * @param newQuarters the new quarter strings.
721      * @param context The formatting context, FORMAT or STANDALONE.
722      * @param width The width of the quarter string,
723      * either WIDE or ABBREVIATED. There are no NARROW quarters.
724      * @internal revisit for ICU 3.6
725      * @deprecated This API is ICU internal only.
726      */

727     public void setQuarters(String JavaDoc[] newQuarters, int context, int width) {
728         switch (context) {
729            case FORMAT :
730               switch(width) {
731                  case WIDE :
732                     quarters = duplicate(newQuarters);
733                     break;
734                  case ABBREVIATED :
735                     shortQuarters = duplicate(newQuarters);
736                     break;
737                  case NARROW :
738                     //narrowQuarters = duplicate(newQuarters);
739
break;
740               }
741               break;
742            case STANDALONE :
743               switch(width) {
744                  case WIDE :
745                     standaloneQuarters = duplicate(newQuarters);
746                     break;
747                  case ABBREVIATED :
748                     standaloneShortQuarters = duplicate(newQuarters);
749                     break;
750                  case NARROW :
751                     //standaloneNarrowQuarters = duplicate(newQuarters);
752
break;
753               }
754               break;
755         }
756     }
757
758     /**
759      * Gets ampm strings. For example: "AM" and "PM".
760      * @return the weekday strings.
761      * @stable ICU 2.0
762      */

763     public String JavaDoc[] getAmPmStrings() {
764         return duplicate(ampms);
765     }
766
767     /**
768      * Sets ampm strings. For example: "AM" and "PM".
769      * @param newAmpms the new ampm strings.
770      * @stable ICU 2.0
771      */

772     public void setAmPmStrings(String JavaDoc[] newAmpms) {
773         ampms = duplicate(newAmpms);
774     }
775
776     /**
777      * Gets timezone strings.
778      * @return the timezone strings.
779      * @stable ICU 2.0
780      */

781     public String JavaDoc[][] getZoneStrings() {
782         String JavaDoc[][] strings = zoneStrings;
783         if(strings == null){
784             // get the default zone strings
785
ZoneItemInfo zii = getDefaultZoneItemInfo();
786             strings = zii.tzStrings;
787         }
788         return duplicate(strings);
789     }
790
791     /**
792      * Sets timezone strings.
793      * @param newZoneStrings the new timezone strings.
794      * @stable ICU 2.0
795      */

796     public void setZoneStrings(String JavaDoc[][] newZoneStrings) {
797         zoneStrings = duplicate(newZoneStrings);
798         // need to update local zone item info
799
localZoneItemInfo = null;
800     }
801
802     /**
803      * Gets localized date-time pattern characters. For example: 'u', 't', etc.
804      * @return the localized date-time pattern characters.
805      * @stable ICU 2.0
806      */

807     public String JavaDoc getLocalPatternChars() {
808         return new String JavaDoc(localPatternChars);
809     }
810
811     /**
812      * Sets localized date-time pattern characters. For example: 'u', 't', etc.
813      * @param newLocalPatternChars the new localized date-time
814      * pattern characters.
815      * @stable ICU 2.0
816      */

817     public void setLocalPatternChars(String JavaDoc newLocalPatternChars) {
818         localPatternChars = newLocalPatternChars;
819     }
820
821     /**
822      * Overrides Cloneable
823      * @stable ICU 2.0
824      */

825     public Object JavaDoc clone()
826     {
827         try {
828             DateFormatSymbols other = (DateFormatSymbols)super.clone();
829             return other;
830         } catch (CloneNotSupportedException JavaDoc e) {
831             ///CLOVER:OFF
832
throw new IllegalStateException JavaDoc();
833             ///CLOVER:ON
834
}
835     }
836
837     /**
838      * Override hashCode.
839      * Generates a hash code for the DateFormatSymbols object.
840      * @stable ICU 2.0
841      */

842     public int hashCode() {
843         int hashcode = 0;
844         hashcode ^= requestedLocale.toString().hashCode();
845         String JavaDoc[][] tzStrings = zoneStrings;
846         if (tzStrings == null){
847             ZoneItemInfo zii = getDefaultZoneItemInfo();
848             tzStrings = zii.tzStrings;
849         }
850         for(int i = 0; i < tzStrings.length; i++) {
851             for (int j = 0; j < tzStrings[i].length; j++) {
852                 if (tzStrings[i][j] != null) {
853                     hashcode ^= tzStrings[i][j].hashCode();
854                 }
855             }
856         }
857         return hashcode;
858     }
859
860     /**
861      * Override equals
862      * @stable ICU 2.0
863      */

864     public boolean equals(Object JavaDoc obj)
865     {
866         if (this == obj) return true;
867         if (obj == null || getClass() != obj.getClass()) return false;
868         DateFormatSymbols that = (DateFormatSymbols) obj;
869         return (Utility.arrayEquals(eras, that.eras)
870                 && Utility.arrayEquals(eraNames, that.eraNames)
871                 && Utility.arrayEquals(months, that.months)
872                 && Utility.arrayEquals(shortMonths, that.shortMonths)
873                 && Utility.arrayEquals(narrowMonths, that.narrowMonths)
874                 && Utility.arrayEquals(standaloneMonths, that.standaloneMonths)
875                 && Utility.arrayEquals(standaloneShortMonths, that.standaloneShortMonths)
876                 && Utility.arrayEquals(standaloneNarrowMonths, that.standaloneNarrowMonths)
877                 && Utility.arrayEquals(weekdays, that.weekdays)
878                 && Utility.arrayEquals(shortWeekdays, that.shortWeekdays)
879                 && Utility.arrayEquals(narrowWeekdays, that.narrowWeekdays)
880                 && Utility.arrayEquals(standaloneWeekdays, that.standaloneWeekdays)
881                 && Utility.arrayEquals(standaloneShortWeekdays, that.standaloneShortWeekdays)
882                 && Utility.arrayEquals(standaloneNarrowWeekdays, that.standaloneNarrowWeekdays)
883                 && Utility.arrayEquals(ampms, that.ampms)
884                 && arrayOfArrayEquals(zoneStrings, that.zoneStrings)
885                 // getDiplayName maps deprecated country and language codes to the current ones
886
// too bad there is no way to get the current codes!
887
// I thought canolicalize() would map the codes but .. alas! it doesn't.
888
&& requestedLocale.getDisplayName().equals(that.requestedLocale.getDisplayName())
889                 && Utility.arrayEquals(localPatternChars,
890                                        that.localPatternChars));
891     }
892
893     // =======================privates===============================
894

895     /**
896      * Useful constant for defining timezone offsets.
897      */

898     static final int millisPerHour = 60*60*1000;
899
900     // DateFormatSymbols cache
901
private static ICUCache DFSCACHE = new SimpleCache();
902
903     /**
904      *
905      * @param desiredLocale
906      * @param type
907      * @stable ICU 3.0
908      */

909     protected void initializeData(ULocale desiredLocale, String JavaDoc type)
910     {
911         String JavaDoc key = desiredLocale.toString() + "+" + type;
912         DateFormatSymbols dfs = (DateFormatSymbols)DFSCACHE.get(key);
913         if (dfs == null) {
914             // Initialize data from scratch put a clone of this instance into the cache
915
CalendarData calData = new CalendarData(desiredLocale, type);
916             initializeData(desiredLocale, calData);
917             dfs = (DateFormatSymbols)this.clone();
918             DFSCACHE.put(key, dfs);
919         } else {
920             initializeData(dfs);
921         }
922     }
923
924     /*
925      * Initialize format symbols using another instance.
926      *
927      * TODO Clean up initialization methods for subclasses
928      */

929     void initializeData(DateFormatSymbols dfs) {
930         this.eras = dfs.eras;
931         this.eraNames = dfs.eraNames;
932         this.narrowEras = dfs.narrowEras;
933         this.months = dfs.months;
934         this.shortMonths = dfs.shortMonths;
935         this.narrowMonths = dfs.narrowMonths;
936         this.standaloneMonths = dfs.standaloneMonths;
937         this.standaloneShortMonths = dfs.standaloneShortMonths;
938         this.standaloneNarrowMonths = dfs.standaloneNarrowMonths;
939         this.weekdays = dfs.weekdays;
940         this.shortWeekdays = dfs.shortWeekdays;
941         this.narrowWeekdays = dfs.narrowWeekdays;
942         this.standaloneWeekdays = dfs.standaloneWeekdays;
943         this.standaloneShortWeekdays = dfs.standaloneShortWeekdays;
944         this.standaloneNarrowWeekdays = dfs.standaloneNarrowWeekdays;
945         this.ampms = dfs.ampms;
946         this.shortQuarters = dfs.shortQuarters;
947         this.quarters = dfs.quarters;
948         this.standaloneShortQuarters = dfs.standaloneShortQuarters;
949         this.standaloneQuarters = dfs.standaloneQuarters;
950
951         this.zoneStrings = dfs.zoneStrings; // always null at initialization time for now
952
this.localPatternChars = dfs.localPatternChars;
953
954         this.actualLocale = dfs.actualLocale;
955         this.validLocale = dfs.validLocale;
956         this.requestedLocale = dfs.requestedLocale;
957     }
958     
959     /**
960      *
961      * @param desiredLocale
962      * @param calData
963      * @stable ICU 3.0
964      */

965     protected void initializeData(ULocale desiredLocale, CalendarData calData)
966     {
967
968         // FIXME: cache only ResourceBundle. Hence every time, will do
969
// getObject(). This won't be necessary if the Resource itself
970
// is cached.
971
eras = calData.getEras("abbreviated");
972
973         try {
974            eraNames = calData.getEras("wide");
975         }
976         catch (MissingResourceException JavaDoc e) {
977            eraNames = calData.getEras("abbreviated");
978         }
979         
980         // NOTE: since the above code assumes that abbreviated
981
// era names exist, we make the same assumption here too.
982
try {
983             narrowEras = calData.getEras("narrow");
984         } catch (MissingResourceException JavaDoc e) {
985             narrowEras = calData.getEras("abbreviated");
986         }
987
988         months = calData.getStringArray("monthNames", "wide");
989         shortMonths = calData.getStringArray("monthNames", "abbreviated");
990
991         try {
992            narrowMonths = calData.getStringArray("monthNames", "narrow");
993         }
994         catch (MissingResourceException JavaDoc e) {
995             try {
996                 narrowMonths = calData.getStringArray("monthNames", "stand-alone", "narrow");
997             }
998             catch (MissingResourceException JavaDoc e1) {
999                narrowMonths = calData.getStringArray("monthNames", "abbreviated");
1000            }
1001        }
1002
1003        try {
1004           standaloneMonths = calData.getStringArray("monthNames", "stand-alone", "wide");
1005        }
1006        catch (MissingResourceException JavaDoc e) {
1007           standaloneMonths = calData.getStringArray("monthNames", "format", "wide");
1008        }
1009
1010        try {
1011           standaloneShortMonths = calData.getStringArray("monthNames", "stand-alone", "abbreviated");
1012        }
1013        catch (MissingResourceException JavaDoc e) {
1014           standaloneShortMonths = calData.getStringArray("monthNames", "format", "abbreviated");
1015        }
1016
1017        try {
1018           standaloneNarrowMonths = calData.getStringArray("monthNames", "stand-alone", "narrow");
1019        }
1020        catch (MissingResourceException JavaDoc e) {
1021           try {
1022              standaloneNarrowMonths = calData.getStringArray("monthNames", "format", "narrow");
1023           }
1024           catch (MissingResourceException JavaDoc e1) {
1025              standaloneNarrowMonths = calData.getStringArray("monthNames", "format", "abbreviated");
1026           }
1027        }
1028
1029        String JavaDoc[] lWeekdays = calData.getStringArray("dayNames", "wide");
1030        weekdays = new String JavaDoc[8];
1031        weekdays[0] = ""; // 1-based
1032
System.arraycopy(lWeekdays, 0, weekdays, 1, lWeekdays.length);
1033
1034        String JavaDoc[] sWeekdays = calData.getStringArray("dayNames", "abbreviated");
1035        shortWeekdays = new String JavaDoc[8];
1036        shortWeekdays[0] = ""; // 1-based
1037
System.arraycopy(sWeekdays, 0, shortWeekdays, 1, sWeekdays.length);
1038
1039        String JavaDoc [] nWeekdays = null;
1040        try {
1041           nWeekdays = calData.getStringArray("dayNames", "narrow");
1042        }
1043        catch (MissingResourceException JavaDoc e) {
1044            try {
1045                nWeekdays = calData.getStringArray("dayNames", "stand-alone", "narrow");
1046            }
1047            catch (MissingResourceException JavaDoc e1) {
1048                nWeekdays = calData.getStringArray("dayNames", "abbreviated");
1049            }
1050        }
1051        narrowWeekdays = new String JavaDoc[8];
1052        narrowWeekdays[0] = ""; // 1-based
1053
System.arraycopy(nWeekdays, 0, narrowWeekdays, 1, nWeekdays.length);
1054
1055        String JavaDoc [] saWeekdays = null;
1056        try {
1057           saWeekdays = calData.getStringArray("dayNames", "stand-alone", "wide");
1058        }
1059        catch (MissingResourceException JavaDoc e) {
1060           saWeekdays = calData.getStringArray("dayNames", "format", "wide");
1061        }
1062        standaloneWeekdays = new String JavaDoc[8];
1063        standaloneWeekdays[0] = ""; // 1-based
1064
System.arraycopy(saWeekdays, 0, standaloneWeekdays, 1, saWeekdays.length);
1065
1066        String JavaDoc [] ssWeekdays = null;
1067        try {
1068           ssWeekdays = calData.getStringArray("dayNames", "stand-alone", "abbreviated");
1069        }
1070        catch (MissingResourceException JavaDoc e) {
1071           ssWeekdays = calData.getStringArray("dayNames", "format", "abbreviated");
1072        }
1073        standaloneShortWeekdays = new String JavaDoc[8];
1074        standaloneShortWeekdays[0] = ""; // 1-based
1075
System.arraycopy(ssWeekdays, 0, standaloneShortWeekdays, 1, ssWeekdays.length);
1076
1077        String JavaDoc [] snWeekdays = null;
1078        try {
1079           snWeekdays = calData.getStringArray("dayNames", "stand-alone", "narrow");
1080        }
1081        catch (MissingResourceException JavaDoc e) {
1082           try {
1083              snWeekdays = calData.getStringArray("dayNames", "format", "narrow");
1084           }
1085           catch (MissingResourceException JavaDoc e1) {
1086              snWeekdays = calData.getStringArray("dayNames", "format", "abbreviated");
1087           }
1088        }
1089        standaloneNarrowWeekdays = new String JavaDoc[8];
1090        standaloneNarrowWeekdays[0] = ""; // 1-based
1091
System.arraycopy(snWeekdays, 0, standaloneNarrowWeekdays, 1, snWeekdays.length);
1092
1093        ampms = calData.getStringArray("AmPmMarkers");
1094        
1095        quarters = calData.getStringArray("quarters", "wide");
1096        shortQuarters = calData.getStringArray("quarters", "abbreviated");
1097
1098        try {
1099           standaloneQuarters = calData.getStringArray("quarters", "stand-alone", "wide");
1100        }
1101        catch (MissingResourceException JavaDoc e) {
1102           standaloneQuarters = calData.getStringArray("quarters", "format", "wide");
1103        }
1104
1105        try {
1106           standaloneShortQuarters = calData.getStringArray("quarters", "stand-alone", "abbreviated");
1107        }
1108        catch (MissingResourceException JavaDoc e) {
1109            standaloneShortQuarters = calData.getStringArray("quarters", "format", "abbreviated");
1110        }
1111        
1112/* THE FOLLOWING DOESN'T WORK; A COUNTRY LOCALE WITH ONE ZONE BLOCKS THE LANGUAGE LOCALE
1113        // These really do use rb and not calData
1114        ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, desiredLocale);
1115        // hack around class cast problem
1116        // zoneStrings = (String[][])rb.getObject("zoneStrings");
1117        ICUResourceBundle zoneObject = rb.get("zoneStrings");
1118        zoneStrings = new String[zoneObject.getSize()][];
1119        for(int i =0; i< zoneObject.getSize(); i++){
1120            ICUResourceBundle zoneArr = zoneObject.get(i);
1121            String[] strings = new String[zoneArr.getSize()];
1122            for(int j=0; j<zoneArr.getSize(); j++){
1123                strings[j]=zoneArr.get(j).getString();
1124            }
1125            zoneStrings[i] = strings;
1126        }
1127*/

1128        requestedLocale = desiredLocale;
1129     
1130        ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, desiredLocale);
1131        localPatternChars = rb.getString("localPatternChars");
1132
1133        // TODO: obtain correct actual/valid locale later
1134
ULocale uloc = rb.getULocale();
1135        setLocale(uloc, uloc);
1136    }
1137
1138    private static final boolean arrayOfArrayEquals(Object JavaDoc[][] aa1, Object JavaDoc[][]aa2) {
1139        if (aa1 == aa2) { // both are null
1140
return true;
1141        }
1142        if (aa1 == null || aa2 == null) { // one is null and the other is not
1143
return false;
1144        }
1145        if (aa1.length != aa2.length) {
1146            return false;
1147        }
1148        boolean equal = true;
1149        for (int i = 0; i < aa1.length; i++) {
1150            equal = Utility.arrayEquals(aa1[i], aa2[i]);
1151            if (!equal) {
1152                break;
1153            }
1154        }
1155        return equal;
1156    }
1157
1158    /**
1159     * Package private: used by SimpleDateFormat.
1160     * Gets the string for the specified time zone.
1161     * @param zid The time zone ID
1162     * @param type The type of zone string
1163     * @return The zone string, or null if not available.
1164     */

1165    String JavaDoc getZoneString(String JavaDoc zid, int type) {
1166        // Try local zone item info first
1167
String JavaDoc zoneString = getZoneString(getLocalZoneItemInfo(), zid, type);
1168        if (zoneString == null) {
1169            // Fallback to the default info
1170
zoneString = getZoneString(getDefaultZoneItemInfo(), zid, type);
1171        }
1172        return zoneString;
1173    }
1174
1175    /**
1176     * Gets the zone string from the specified zone item info
1177     */

1178    private String JavaDoc getZoneString(ZoneItemInfo zinfo, String JavaDoc zid, int type) {
1179        if (zinfo == null) {
1180            return null;
1181        }
1182        String JavaDoc[] names = (String JavaDoc[])zinfo.tzidMap.get(zid);
1183        if (names != null) {
1184            // get name for the type
1185
int index = -1;
1186            switch (type) {
1187            case TIMEZONE_LONG_STANDARD:
1188                index = 1;
1189                break;
1190            case TIMEZONE_SHORT_STANDARD:
1191                index = 2;
1192                break;
1193            case TIMEZONE_LONG_DAYLIGHT:
1194                index = 3;
1195                break;
1196            case TIMEZONE_SHORT_DAYLIGHT:
1197                index = 4;
1198                break;
1199            case TIMEZONE_EXEMPLAR_CITY:
1200                if (names.length == 6 || names.length == 8) {
1201                    index = 5;
1202                }
1203                break;
1204            case TIMEZONE_LONG_GENERIC:
1205                if (names.length == 8) {
1206                    index = 6;
1207                } else {
1208                    index = 5;
1209                }
1210                break;
1211            case TIMEZONE_SHORT_GENERIC:
1212                if (names.length == 8) {
1213                    index = 7;
1214                } else {
1215                    index = 6;
1216                }
1217            }
1218            if (index < names.length) {
1219                return names[index];
1220            }
1221        }
1222        return null;
1223    }
1224
1225    class ZoneItem{
1226        String JavaDoc value;
1227        int type;
1228        String JavaDoc zid;
1229    }
1230
1231    /**
1232     * Package private: used by SimpleDateformat
1233     * Gets the ZoneItem instance which has zone strings
1234     * which matches the specified text.
1235     * @param text The text which contains a zone string
1236     * @param start The start position of zone string in the text
1237     * @return A ZonItem instance for the longest matching zone
1238     * string.
1239     */

1240    ZoneItem findZoneIDTypeValue(String JavaDoc text, int start){
1241        ZoneItem item = null;
1242        int textLength = text.length() - start;
1243        if (lastZoneItem != null && textLength == lastZoneItem.value.length()) {
1244            if (text.regionMatches(true, start, lastZoneItem.value, 0, textLength)) {
1245                item = new ZoneItem();
1246                item.type = lastZoneItem.type;
1247                item.value = lastZoneItem.value;
1248                item.zid = lastZoneItem.zid;
1249                return item;
1250            }
1251        }
1252
1253        ZoneItemInfo zinfo = getLocalZoneItemInfo();
1254        if (zinfo != null) {
1255            // look up the zone string in localZoneItemInfo first
1256
item = (ZoneItem)zinfo.tzStringMap.get(text, start);
1257        }
1258
1259        // look up the zone string in default ZoneItemInfo for the locale
1260
zinfo = getDefaultZoneItemInfo();
1261        ZoneItem itemForLocale = (ZoneItem)zinfo.tzStringMap.get(text, start);
1262        if (itemForLocale != null) {
1263            // we want to use longer match
1264
if (item == null || itemForLocale.value.length() > item.value.length()) {
1265                item = itemForLocale;
1266            }
1267        }
1268
1269        if (item != null && textLength == item.value.length()) {
1270            // clone the last match for next time
1271
// only when the substring completely matches
1272
// with the value resolved
1273
lastZoneItem = new ZoneItem();
1274            lastZoneItem.type = item.type;
1275            lastZoneItem.value = item.value;
1276            lastZoneItem.zid = item.zid;
1277        }
1278        return item;
1279    }
1280
1281    /**
1282     * A class holds zone strings and searchable indice
1283     */

1284    private class ZoneItemInfo {
1285        String JavaDoc[][] tzStrings;
1286        HashMap JavaDoc tzidMap;
1287        TextTrieMap tzStringMap;
1288    }
1289
1290    /**
1291     * A cache for ZoneItemInfo objects, shared by class instances.
1292     */

1293    private static ICUCache zoneItemInfoCache = new SimpleCache();
1294
1295    /**
1296     * A ZoneItemInfo instance which holds custom timezone strings
1297     */

1298    private transient ZoneItemInfo localZoneItemInfo;
1299
1300    /**
1301     * Single entry cache for findZoneTypeValue()
1302     */

1303    private transient ZoneItem lastZoneItem;
1304
1305    /**
1306     * Gets the ZoneItemInfo instance for the locale used by this object.
1307     * If it does not exist, create new one and register in the static cache.
1308     */

1309    private ZoneItemInfo getDefaultZoneItemInfo() {
1310        ZoneItemInfo zii = (ZoneItemInfo)zoneItemInfoCache.get(requestedLocale);
1311        if (zii != null) {
1312            return zii;
1313        }
1314        zii = getZoneItemInfo(getDefaultZoneStrings(requestedLocale));
1315        // Add fallback display names
1316
String JavaDoc[] zoneIDs = TimeZone.getAvailableIDs();
1317        for (int i = 0; i < zoneIDs.length; i++) {
1318            Object JavaDoc o = zii.tzidMap.get(zoneIDs[i]);
1319            if (o != null) {
1320                // Already has names
1321
continue;
1322            }
1323            String JavaDoc value = ZoneMeta.displayFallback(zoneIDs[i], null, requestedLocale);
1324            if (value != null) {
1325                String JavaDoc[] strings = new String JavaDoc[8];
1326                strings[5] = value;
1327                zii.tzidMap.put(zoneIDs[i], strings);
1328                
1329                ZoneItem item = new ZoneItem();
1330                item.zid = zoneIDs[i];
1331                item.value = value;
1332                item.type = TIMEZONE_EXEMPLAR_CITY;
1333                zii.tzStringMap.put(item.value, item);
1334            }
1335        }
1336        zoneItemInfoCache.put(requestedLocale, zii);
1337        return zii;
1338    }
1339
1340    /**
1341     * Gets the array of zone strings for the specified locale.
1342     */

1343    private static String JavaDoc[][] getDefaultZoneStrings(ULocale locale) {
1344        ArrayList JavaDoc tmpList = new ArrayList JavaDoc();
1345        HashSet JavaDoc tmpSet = new HashSet JavaDoc();
1346        for (ULocale tempLocale = locale; tempLocale != null; tempLocale = tempLocale.getFallback()) {
1347            ICUResourceBundle bundle = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, tempLocale);
1348            ICUResourceBundle zoneStringsBundle = bundle.getWithFallback("zoneStrings");
1349            for(int i = 0; i < zoneStringsBundle.getSize(); i++){
1350                ICUResourceBundle zoneTable = zoneStringsBundle.get(i);
1351                String JavaDoc key = Utility.replaceAll(zoneTable.getKey(), ":", "/");
1352                // hack for the root zone strings
1353
if(key.length() == 0|| zoneTable.getType() != ICUResourceBundle.TABLE){
1354                    continue;
1355                }
1356                if (tmpSet.contains(key)) {
1357                    // only add if we don't have already
1358
continue;
1359                }
1360                String JavaDoc[] strings = new String JavaDoc[8];
1361                strings[0] = key;
1362                try {
1363                    strings[1] = zoneTable.getStringWithFallback(LONG_STANDARD);
1364                } catch (MissingResourceException JavaDoc ex) {
1365                    // throw away the exception
1366
}
1367                try {
1368                    strings[2] = zoneTable.getStringWithFallback(SHORT_STANDARD);
1369                } catch (MissingResourceException JavaDoc ex) {
1370                    // throw away the exception
1371
}
1372                try {
1373                    strings[3] = zoneTable.getStringWithFallback(LONG_DAYLIGHT);
1374                } catch (MissingResourceException JavaDoc ex) {
1375                    // throw away the exception
1376
}
1377                try {
1378                    strings[4] = zoneTable.getStringWithFallback(SHORT_DAYLIGHT);
1379                } catch (MissingResourceException JavaDoc ex) {
1380                    // throw away the exception
1381
}
1382                try {
1383                    String JavaDoc city = zoneTable.getStringWithFallback(EXEMPLAR_CITY);
1384                    strings[5] = ZoneMeta.displayFallback(key, city, tempLocale);
1385                } catch (MissingResourceException JavaDoc ex) {
1386                    // throw away the exception
1387
}
1388                try {
1389                    strings[6] = zoneTable.getStringWithFallback(LONG_GENERIC);
1390                } catch (MissingResourceException JavaDoc ex) {
1391                    // throw away the exception
1392
}
1393                try {
1394                    strings[7] = zoneTable.getStringWithFallback(SHORT_GENERIC);
1395                } catch (MissingResourceException JavaDoc ex) {
1396                    // throw away the exception
1397
}
1398                tmpList.add(strings);
1399            }
1400        }
1401        String JavaDoc[][] array = new String JavaDoc[tmpList.size()][8];
1402        tmpList.toArray(array);
1403        return array;
1404    }
1405
1406    /**
1407     * Gets the array of zone strings for the custom zone strings
1408     */

1409    private ZoneItemInfo getLocalZoneItemInfo() {
1410        if (localZoneItemInfo == null && zoneStrings != null) {
1411            localZoneItemInfo = getZoneItemInfo(zoneStrings);
1412        }
1413        return localZoneItemInfo;
1414    }
1415
1416    /**
1417     * Creates a new ZoneItemInfo instance from the array of time zone
1418     * strings.
1419     */

1420    private ZoneItemInfo getZoneItemInfo(String JavaDoc[][] strings) {
1421        ZoneItemInfo zii = new ZoneItemInfo();
1422        zii.tzStrings = strings;
1423        zii.tzidMap = new HashMap JavaDoc();
1424        zii.tzStringMap = new TextTrieMap(true);
1425        for (int i = 0; i < strings.length; i++) {
1426            String JavaDoc zid = strings[i][0];
1427            if (zid != null && zid.length() > 0) {
1428                zii.tzidMap.put(zid, strings[i]);
1429                int nameCount = strings[i].length < 8 ? strings[i].length : 8;
1430                for (int j = 1; j < nameCount; j++) {
1431                    if (strings[i][j] != null) {
1432                        // map zoneStrings array index to timezone name type
1433
int type = -1;
1434                        switch (j) {
1435                        case 1:
1436                            type = TIMEZONE_LONG_STANDARD;
1437                            break;
1438                        case 2:
1439                            type = TIMEZONE_SHORT_STANDARD;
1440                            break;
1441                        case 3:
1442                            type = TIMEZONE_LONG_DAYLIGHT;
1443                            break;
1444                        case 4:
1445                            type = TIMEZONE_SHORT_DAYLIGHT;
1446                            break;
1447                        case 5:
1448                            if (nameCount == 6 || nameCount == 8) {
1449                                type = TIMEZONE_EXEMPLAR_CITY;
1450                            } else {
1451                                type = TIMEZONE_LONG_GENERIC;
1452                            }
1453                            break;
1454                        case 6:
1455                            if (nameCount == 8) {
1456                                type = TIMEZONE_LONG_GENERIC;
1457                            } else {
1458                                type = TIMEZONE_SHORT_GENERIC;
1459                            }
1460                            break;
1461                        case 7:
1462                            type = TIMEZONE_SHORT_GENERIC;
1463                            break;
1464                        default:
1465                            // never occur
1466
continue;
1467                        }
1468                        ZoneItem item = new ZoneItem();
1469                        item.zid = zid;
1470                        item.value = strings[i][j];
1471                        item.type = type;
1472                        zii.tzStringMap.put(strings[i][j], item);
1473                    }
1474                }
1475            }
1476        }
1477        return zii;
1478    }
1479
1480    /**
1481     * save the input locale
1482     */

1483    private ULocale requestedLocale;
1484 
1485    /**
1486     * The translation type of the translated zone strings
1487     * @internal ICU 3.6
1488     * @deprecated This API is ICU internal only.
1489     */

1490     private static final String JavaDoc SHORT_GENERIC = "sg",
1491                                   SHORT_STANDARD = "ss",
1492                                   SHORT_DAYLIGHT = "sd",
1493                                   LONG_GENERIC = "lg",
1494                                   LONG_STANDARD = "ls",
1495                                   LONG_DAYLIGHT = "ld",
1496                                   EXEMPLAR_CITY = "ec";
1497    /**
1498     * The translation type of the translated zone strings
1499     * @internal ICU 3.6
1500     * @deprecated This API is ICU internal only.
1501     */

1502     static final int TIMEZONE_SHORT_GENERIC = 0,
1503                        TIMEZONE_SHORT_STANDARD = 1,
1504                        TIMEZONE_SHORT_DAYLIGHT = 2,
1505                        TIMEZONE_LONG_GENERIC = 3,
1506                        TIMEZONE_LONG_STANDARD = 4,
1507                        TIMEZONE_LONG_DAYLIGHT = 5,
1508                        TIMEZONE_EXEMPLAR_CITY = 6,
1509                        TIMEZONE_COUNT = 7;
1510
1511     /*
1512     * Package private: used by SimpleDateFormat
1513     * Gets the index for the given time zone ID to obtain the timezone
1514     * strings for formatting. The time zone ID is just for programmatic
1515     * lookup. NOT LOCALIZED!!!
1516     * @param ID the given time zone ID.
1517     * @return the index of the given time zone ID. Returns -1 if
1518     * the given time zone ID can't be located in the DateFormatSymbols object.
1519     * @see com.ibm.icu.util.SimpleTimeZone
1520     */

1521/* final int getZoneIndex(String ID) {
1522        int result = _getZoneIndex(ID);
1523        if (result >= 0) {
1524            return result;
1525        }
1526        // Do a search through the equivalency group for the given ID
1527        int n = ZoneMeta.countEquivalentIDs(ID);
1528        if (n > 1) {
1529            for (int i=0; i<n; ++i) {
1530                String equivID = ZoneMeta.getEquivalentID(ID, i);
1531                if (!equivID.equals(ID)) {
1532                    int equivResult = _getZoneIndex(equivID);
1533                    if (equivResult >= 0) {
1534                        return equivResult;
1535                    }
1536                }
1537            }
1538        }
1539        return -1;
1540    }*/

1541    
1542    /*
1543     * Lookup the given ID. Do NOT do an equivalency search.
1544     */

1545/* private int _getZoneIndex(String ID)
1546    {
1547        for (int index=0; index<zoneStrings.length; index++) {
1548            if (ID.equalsIgnoreCase(zoneStrings[index][0])) return index;
1549        }
1550        return -1;
1551    }*/

1552
1553    /**
1554     * Clones an array of Strings.
1555     * @param srcArray the source array to be cloned.
1556     * @return a cloned array.
1557     */

1558    private final String JavaDoc[] duplicate(String JavaDoc[] srcArray)
1559    {
1560        return (String JavaDoc[])srcArray.clone();
1561    }
1562
1563    private final String JavaDoc[][] duplicate(String JavaDoc[][] srcArray)
1564    {
1565        String JavaDoc[][] aCopy = new String JavaDoc[srcArray.length][];
1566        for (int i = 0; i < srcArray.length; ++i)
1567            aCopy[i] = duplicate(srcArray[i]);
1568        return aCopy;
1569    }
1570
1571    /**
1572     * Compares the equality of the two arrays of String.
1573     * @param current this String array.
1574     * @param other that String array.
1575    private final boolean equals(String[] current, String[] other)
1576    {
1577        int count = current.length;
1578
1579        for (int i = 0; i < count; ++i)
1580            if (!current[i].equals(other[i]))
1581                return false;
1582        return true;
1583    }
1584     */

1585
1586    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1587

1588    /**
1589     * Get the {@link DateFormatSymbols} object that should be used to format a
1590     * calendar system's dates in the given locale.
1591     * <p>
1592     * <b>Subclassing:</b><br>
1593     * When creating a new Calendar subclass, you must create the
1594     * {@link ResourceBundle ResourceBundle}
1595     * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
1596     * The resource bundle name is based on the calendar's fully-specified
1597     * class name, with ".resources" inserted at the end of the package name
1598     * (just before the class name) and "Symbols" appended to the end.
1599     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
1600     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
1601     * <p>
1602     * Within the ResourceBundle, this method searches for five keys:
1603     * <ul>
1604     * <li><b>DayNames</b> -
1605     * An array of strings corresponding to each possible
1606     * value of the <code>DAY_OF_WEEK</code> field. Even though
1607     * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
1608     * This array is 0-based; the name for Sunday goes in the
1609     * first position, at index 0. If this key is not found
1610     * in the bundle, the day names are inherited from the
1611     * default <code>DateFormatSymbols</code> for the requested locale.
1612     *
1613     * <li><b>DayAbbreviations</b> -
1614     * An array of abbreviated day names corresponding
1615     * to the values in the "DayNames" array. If this key
1616     * is not found in the resource bundle, the "DayNames"
1617     * values are used instead. If neither key is found,
1618     * the day abbreviations are inherited from the default
1619     * <code>DateFormatSymbols</code> for the locale.
1620     *
1621     * <li><b>MonthNames</b> -
1622     * An array of strings corresponding to each possible
1623     * value of the <code>MONTH</code> field. If this key is not found
1624     * in the bundle, the month names are inherited from the
1625     * default <code>DateFormatSymbols</code> for the requested locale.
1626     *
1627     * <li><b>MonthAbbreviations</b> -
1628     * An array of abbreviated day names corresponding
1629     * to the values in the "MonthNames" array. If this key
1630     * is not found in the resource bundle, the "MonthNames"
1631     * values are used instead. If neither key is found,
1632     * the day abbreviations are inherited from the default
1633     * <code>DateFormatSymbols</code> for the locale.
1634     *
1635     * <li><b>Eras</b> -
1636     * An array of strings corresponding to each possible
1637     * value of the <code>ERA</code> field. If this key is not found
1638     * in the bundle, the era names are inherited from the
1639     * default <code>DateFormatSymbols</code> for the requested locale.
1640     * </ul>
1641     * <p>
1642     * @param cal The calendar system whose date format symbols are desired.
1643     * @param locale The locale whose symbols are desired.
1644     *
1645     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
1646     * @stable ICU 2.0
1647     */

1648    public DateFormatSymbols(Calendar cal, Locale JavaDoc locale) {
1649        initializeData(ULocale.forLocale(locale), cal.getType());
1650    }
1651
1652    /**
1653     * Get the {@link DateFormatSymbols} object that should be used to format a
1654     * calendar system's dates in the given locale.
1655     * <p>
1656     * <b>Subclassing:</b><br>
1657     * When creating a new Calendar subclass, you must create the
1658     * {@link ResourceBundle ResourceBundle}
1659     * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place.
1660     * The resource bundle name is based on the calendar's fully-specified
1661     * class name, with ".resources" inserted at the end of the package name
1662     * (just before the class name) and "Symbols" appended to the end.
1663     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
1664     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
1665     * <p>
1666     * Within the ResourceBundle, this method searches for five keys:
1667     * <ul>
1668     * <li><b>DayNames</b> -
1669     * An array of strings corresponding to each possible
1670     * value of the <code>DAY_OF_WEEK</code> field. Even though
1671     * <code>DAY_OF_WEEK</code> starts with <code>SUNDAY</code> = 1,
1672     * This array is 0-based; the name for Sunday goes in the
1673     * first position, at index 0. If this key is not found
1674     * in the bundle, the day names are inherited from the
1675     * default <code>DateFormatSymbols</code> for the requested locale.
1676     *
1677     * <li><b>DayAbbreviations</b> -
1678     * An array of abbreviated day names corresponding
1679     * to the values in the "DayNames" array. If this key
1680     * is not found in the resource bundle, the "DayNames"
1681     * values are used instead. If neither key is found,
1682     * the day abbreviations are inherited from the default
1683     * <code>DateFormatSymbols</code> for the locale.
1684     *
1685     * <li><b>MonthNames</b> -
1686     * An array of strings corresponding to each possible
1687     * value of the <code>MONTH</code> field. If this key is not found
1688     * in the bundle, the month names are inherited from the
1689     * default <code>DateFormatSymbols</code> for the requested locale.
1690     *
1691     * <li><b>MonthAbbreviations</b> -
1692     * An array of abbreviated day names corresponding
1693     * to the values in the "MonthNames" array. If this key
1694     * is not found in the resource bundle, the "MonthNames"
1695     * values are used instead. If neither key is found,
1696     * the day abbreviations are inherited from the default
1697     * <code>DateFormatSymbols</code> for the locale.
1698     *
1699     * <li><b>Eras</b> -
1700     * An array of strings corresponding to each possible
1701     * value of the <code>ERA</code> field. If this key is not found
1702     * in the bundle, the era names are inherited from the
1703     * default <code>DateFormatSymbols</code> for the requested locale.
1704     * </ul>
1705     * <p>
1706     * @param cal The calendar system whose date format symbols are desired.
1707     * @param locale The ulocale whose symbols are desired.
1708     *
1709     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
1710     * @draft ICU 3.2
1711     * @provisional This API might change or be removed in a future release.
1712     */

1713    public DateFormatSymbols(Calendar cal, ULocale locale) {
1714        initializeData(locale, cal.getType());
1715    }
1716
1717    /**
1718     * Variant of DateFormatSymbols(Calendar, Locale) that takes the Calendar class
1719     * instead of a Calandar instance.
1720     * @see #DateFormatSymbols(Calendar, Locale)
1721     * @stable ICU 2.2
1722     */

1723    public DateFormatSymbols(Class JavaDoc calendarClass, Locale JavaDoc locale) {
1724        this(calendarClass, ULocale.forLocale(locale));
1725    }
1726
1727    /**
1728     * Variant of DateFormatSymbols(Calendar, ULocale) that takes the Calendar class
1729     * instead of a Calandar instance.
1730     * @see #DateFormatSymbols(Calendar, Locale)
1731     * @draft ICU 3.2
1732     * @provisional This API might change or be removed in a future release.
1733     */

1734    public DateFormatSymbols(Class JavaDoc calendarClass, ULocale locale) {
1735        String JavaDoc fullName = calendarClass.getName();
1736        int lastDot = fullName.lastIndexOf('.');
1737        String JavaDoc className = fullName.substring(lastDot+1);
1738        String JavaDoc calType = Utility.replaceAll(className, "Calendar", "").toLowerCase();
1739        
1740        initializeData(locale, calType);
1741    }
1742
1743    /**
1744     * Fetch a custom calendar's DateFormatSymbols out of the given resource
1745     * bundle. Symbols that are not overridden are inherited from the
1746     * default DateFormatSymbols for the locale.
1747     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
1748     * @stable ICU 2.0
1749     */

1750    public DateFormatSymbols(ResourceBundle JavaDoc bundle, Locale JavaDoc locale) {
1751        this(bundle, ULocale.forLocale(locale));
1752    }
1753
1754    /**
1755     * Fetch a custom calendar's DateFormatSymbols out of the given resource
1756     * bundle. Symbols that are not overridden are inherited from the
1757     * default DateFormatSymbols for the locale.
1758     * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale)
1759     * @draft ICU 3.2
1760     * @provisional This API might change or be removed in a future release.
1761     */

1762    public DateFormatSymbols(ResourceBundle JavaDoc bundle, ULocale locale) {
1763        initializeData(locale,
1764            new CalendarData((ICUResourceBundle)bundle, null));
1765    }
1766
1767    /**
1768     * Find the ResourceBundle containing the date format information for
1769     * a specified calendar subclass in a given locale.
1770     * <p>
1771     * The resource bundle name is based on the calendar's fully-specified
1772     * class name, with ".resources" inserted at the end of the package name
1773     * (just before the class name) and "Symbols" appended to the end.
1774     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
1775     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
1776     * @stable ICU 2.0
1777     */

1778    static public ResourceBundle JavaDoc getDateFormatBundle(Class JavaDoc calendarClass, Locale JavaDoc locale)
1779        throws MissingResourceException JavaDoc {
1780        return getDateFormatBundle(calendarClass, ULocale.forLocale(locale));
1781    }
1782        
1783    /**
1784     * Find the ResourceBundle containing the date format information for
1785     * a specified calendar subclass in a given locale.
1786     * <p>
1787     * The resource bundle name is based on the calendar's fully-specified
1788     * class name, with ".resources" inserted at the end of the package name
1789     * (just before the class name) and "Symbols" appended to the end.
1790     * For example, the bundle corresponding to "com.ibm.icu.util.HebrewCalendar"
1791     * is "com.ibm.icu.impl.data.HebrewCalendarSymbols".
1792     * @draft ICU 3.2
1793     * @provisional This API might change or be removed in a future release.
1794     */

1795    static public ResourceBundle JavaDoc getDateFormatBundle(Class JavaDoc calendarClass, ULocale locale)
1796        throws MissingResourceException JavaDoc {
1797        
1798        // Find the calendar's class name, which we're going to use to construct the
1799
// resource bundle name.
1800
String JavaDoc fullName = calendarClass.getName();
1801        int lastDot = fullName.lastIndexOf('.');
1802        String JavaDoc className = fullName.substring(lastDot+1);
1803
1804        String JavaDoc bundleName = className + "Symbols";
1805
1806        UResourceBundle result = null;
1807        try {
1808            result = UResourceBundle.getBundleInstance(bundleName, locale);
1809        }
1810        catch (MissingResourceException JavaDoc e) {
1811            ///CLOVER:OFF
1812
// coverage requires test without data, so skip
1813
//if (!(cal instanceof GregorianCalendar)) {
1814
if (!(GregorianCalendar.class.isAssignableFrom(calendarClass))) {
1815                // Ok for symbols to be missing for a Gregorian calendar, but
1816
// not for any other type.
1817
throw e;
1818            }
1819            ///CLOVER:ON
1820
}
1821        return result;
1822    }
1823
1824    /**
1825     * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
1826     * a Calendar instance instead of a Calendar class.
1827     * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
1828     * @stable ICU 2.2
1829     */

1830    public static ResourceBundle JavaDoc getDateFormatBundle(Calendar cal, Locale JavaDoc locale)
1831        throws MissingResourceException JavaDoc {
1832        return getDateFormatBundle(cal.getClass(), ULocale.forLocale(locale));
1833    }
1834    
1835    /**
1836     * Variant of getDateFormatBundle(java.lang.Class, java.util.Locale) that takes
1837     * a Calendar instance instead of a Calendar class.
1838     * @see #getDateFormatBundle(java.lang.Class, java.util.Locale)
1839     * @draft ICU 3.2
1840     * @provisional This API might change or be removed in a future release.
1841     */

1842    public static ResourceBundle JavaDoc getDateFormatBundle(Calendar cal, ULocale locale)
1843        throws MissingResourceException JavaDoc {
1844        return getDateFormatBundle(cal.getClass(), locale);
1845    }
1846    
1847    // -------- BEGIN ULocale boilerplate --------
1848

1849    /**
1850     * Return the locale that was used to create this object, or null.
1851     * This may may differ from the locale requested at the time of
1852     * this object's creation. For example, if an object is created
1853     * for locale <tt>en_US_CALIFORNIA</tt>, the actual data may be
1854     * drawn from <tt>en</tt> (the <i>actual</i> locale), and
1855     * <tt>en_US</tt> may be the most specific locale that exists (the
1856     * <i>valid</i> locale).
1857     *
1858     * <p>Note: This method will be implemented in ICU 3.0; ICU 2.8
1859     * contains a partial preview implementation. The * <i>actual</i>
1860     * locale is returned correctly, but the <i>valid</i> locale is
1861     * not, in most cases.
1862     * @param type type of information requested, either {@link
1863     * com.ibm.icu.util.ULocale#VALID_LOCALE} or {@link
1864     * com.ibm.icu.util.ULocale#ACTUAL_LOCALE}.
1865     * @return the information specified by <i>type</i>, or null if
1866     * this object was not constructed from locale data.
1867     * @see com.ibm.icu.util.ULocale
1868     * @see com.ibm.icu.util.ULocale#VALID_LOCALE
1869     * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
1870     * @draft ICU 2.8 (retain)
1871     * @provisional This API might change or be removed in a future release.
1872     */

1873    public final ULocale getLocale(ULocale.Type type) {
1874        return type == ULocale.ACTUAL_LOCALE ?
1875            this.actualLocale : this.validLocale;
1876    }
1877
1878    /**
1879     * Set information about the locales that were used to create this
1880     * object. If the object was not constructed from locale data,
1881     * both arguments should be set to null. Otherwise, neither
1882     * should be null. The actual locale must be at the same level or
1883     * less specific than the valid locale. This method is intended
1884     * for use by factories or other entities that create objects of
1885     * this class.
1886     * @param valid the most specific locale containing any resource
1887     * data, or null
1888     * @param actual the locale containing data used to construct this
1889     * object, or null
1890     * @see com.ibm.icu.util.ULocale
1891     * @see com.ibm.icu.util.ULocale#VALID_LOCALE
1892     * @see com.ibm.icu.util.ULocale#ACTUAL_LOCALE
1893     * @internal
1894     * @deprecated This API is ICU internal only.
1895     */

1896    final void setLocale(ULocale valid, ULocale actual) {
1897        // Change the following to an assertion later
1898
if ((valid == null) != (actual == null)) {
1899            ///CLOVER:OFF
1900
throw new IllegalArgumentException JavaDoc();
1901            ///CLOVER:ON
1902
}
1903        // Another check we could do is that the actual locale is at
1904
// the same level or less specific than the valid locale.
1905
this.validLocale = valid;
1906        this.actualLocale = actual;
1907    }
1908
1909    /**
1910     * The most specific locale containing any resource data, or null.
1911     * @see com.ibm.icu.util.ULocale
1912     * @internal
1913     * @deprecated This API is ICU internal only.
1914     */

1915    private ULocale validLocale;
1916
1917    /**
1918     * The locale containing data used to construct this object, or
1919     * null.
1920     * @see com.ibm.icu.util.ULocale
1921     * @internal
1922     * @deprecated This API is ICU internal only.
1923     */

1924    private ULocale actualLocale;
1925
1926    // -------- END ULocale boilerplate --------
1927
}
1928
Popular Tags