1 /****************************************************************************
\r
2 * Copyright (C) 2000-2008, International Business Machines Corporation and
\r
3 * others. All Rights Reserved.
\r
4 ****************************************************************************
\r
7 package com.ibm.icu.text;
\r
9 import com.ibm.icu.impl.CalendarData;
\r
10 import com.ibm.icu.util.*;
\r
11 import java.util.Locale;
\r
14 * A subclass of {@link DateFormatSymbols} for {@link ChineseDateFormat}.
\r
15 * This class contains additional symbols corresponding to the
\r
16 * <code>ChineseCalendar.IS_LEAP_MONTH</code> field.
\r
18 * @see ChineseDateFormat
\r
19 * @see com.ibm.icu.util.ChineseCalendar
\r
23 public class ChineseDateFormatSymbols extends DateFormatSymbols {
\r
24 // Generated by serialver from JDK 1.4.1_01
\r
25 static final long serialVersionUID = 6827816119783952890L;
\r
28 * Package-private array that ChineseDateFormat needs to be able to
\r
31 String isLeapMonth[]; // Do NOT add =null initializer
\r
34 * Construct a ChineseDateFormatSymbols for the default locale.
\r
37 public ChineseDateFormatSymbols() {
\r
38 this(ULocale.getDefault());
\r
42 * Construct a ChineseDateFormatSymbols for the provided locale.
\r
43 * @param locale the locale
\r
46 public ChineseDateFormatSymbols(Locale locale) {
\r
47 super(ChineseCalendar.class, ULocale.forLocale(locale));
\r
51 * Construct a ChineseDateFormatSymbols for the provided locale.
\r
52 * @param locale the locale
\r
55 public ChineseDateFormatSymbols(ULocale locale) {
\r
56 super(ChineseCalendar.class, locale);
\r
60 * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
\r
61 * @param cal the Calendar
\r
62 * @param locale the locale
\r
65 public ChineseDateFormatSymbols(Calendar cal, Locale locale) {
\r
66 super(cal==null?null:cal.getClass(), locale);
\r
70 * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
\r
71 * @param cal the Calendar
\r
72 * @param locale the locale
\r
75 public ChineseDateFormatSymbols(Calendar cal, ULocale locale) {
\r
76 super(cal == null ? null : cal.getClass(), locale);
\r
83 public String getLeapMonth(int leap) {
\r
84 return isLeapMonth[leap];
\r
91 protected void initializeData(ULocale loc, CalendarData calData) {
\r
92 super.initializeData(loc, calData);
\r
93 isLeapMonth = calData.getStringArray("isLeapMonth");
\r
96 void initializeData(DateFormatSymbols dfs) {
\r
97 super.initializeData(dfs);
\r
98 if (dfs instanceof ChineseDateFormatSymbols) {
\r
99 this.isLeapMonth = ((ChineseDateFormatSymbols)dfs).isLeapMonth;
\r