01: /****************************************************************************
02: * Copyright (C) 2000-2006, International Business Machines Corporation and
03: * others. All Rights Reserved.
04: ****************************************************************************
05: */package com.ibm.icu.text;
06:
07: import com.ibm.icu.impl.CalendarData;
08: import com.ibm.icu.util.*;
09: import java.util.Locale;
10:
11: /**
12: * A subclass of {@link DateFormatSymbols} for {@link ChineseDateFormat}.
13: * This class contains additional symbols corresponding to the
14: * <code>ChineseCalendar.IS_LEAP_MONTH</code> field.
15: *
16: * @see ChineseDateFormat
17: * @see com.ibm.icu.util.ChineseCalendar
18: * @author Alan Liu
19: * @stable ICU 2.0
20: */
21: public class ChineseDateFormatSymbols extends DateFormatSymbols {
22: // Generated by serialver from JDK 1.4.1_01
23: static final long serialVersionUID = 6827816119783952890L;
24:
25: /**
26: * Package-private array that ChineseDateFormat needs to be able to
27: * read.
28: */
29: String isLeapMonth[]; // Do NOT add =null initializer
30:
31: /**
32: * Construct a ChineseDateFormatSymbols for the default locale.
33: * @stable ICU 2.0
34: */
35: public ChineseDateFormatSymbols() {
36: this (ULocale.getDefault());
37: }
38:
39: /**
40: * Construct a ChineseDateFormatSymbols for the provided locale.
41: * @param locale the locale
42: * @stable ICU 2.0
43: */
44: public ChineseDateFormatSymbols(Locale locale) {
45: super (ChineseCalendar.class, ULocale.forLocale(locale));
46: }
47:
48: /**
49: * Construct a ChineseDateFormatSymbols for the provided locale.
50: * @param locale the locale
51: * @draft ICU 3.2
52: * @provisional This API might change or be removed in a future release.
53: */
54: public ChineseDateFormatSymbols(ULocale locale) {
55: super (ChineseCalendar.class, locale);
56: }
57:
58: /**
59: * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
60: * @param cal the Calendar
61: * @param locale the locale
62: * @stable ICU 2.0
63: */
64: public ChineseDateFormatSymbols(Calendar cal, Locale locale) {
65: super (cal == null ? null : cal.getClass(), locale);
66: }
67:
68: /**
69: * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
70: * @param cal the Calendar
71: * @param locale the locale
72: * @draft ICU 3.2
73: * @provisional This API might change or be removed in a future release.
74: */
75: public ChineseDateFormatSymbols(Calendar cal, ULocale locale) {
76: super (cal == null ? null : cal.getClass(), locale);
77: }
78:
79: // New API
80: /**
81: * @stable ICU 2.0
82: */
83: public String getLeapMonth(int isLeapMonth) {
84: return this .isLeapMonth[isLeapMonth];
85: }
86:
87: /**
88: * @stable ICU 3.0
89: */
90: protected void initializeData(ULocale loc, CalendarData calData) {
91: super .initializeData(loc, calData);
92: isLeapMonth = calData.getStringArray("isLeapMonth");
93: }
94: }
|