1 /****************************************************************************
\r
2 * Copyright (C) 2000-2010, International Business Machines Corporation and
\r
3 * others. All Rights Reserved.
\r
4 ****************************************************************************
\r
7 package com.ibm.icu.text;
\r
9 import java.util.Locale;
\r
11 import com.ibm.icu.impl.CalendarData;
\r
12 import com.ibm.icu.util.Calendar;
\r
13 import com.ibm.icu.util.ChineseCalendar;
\r
14 import com.ibm.icu.util.ULocale;
\r
17 * A subclass of {@link DateFormatSymbols} for {@link ChineseDateFormat}.
\r
18 * This class contains additional symbols corresponding to the
\r
19 * <code>ChineseCalendar.IS_LEAP_MONTH</code> field.
\r
21 * @see ChineseDateFormat
\r
22 * @see com.ibm.icu.util.ChineseCalendar
\r
26 public class ChineseDateFormatSymbols extends DateFormatSymbols {
\r
27 // Generated by serialver from JDK 1.4.1_01
\r
28 static final long serialVersionUID = 6827816119783952890L;
\r
31 * Package-private array that ChineseDateFormat needs to be able to
\r
34 String isLeapMonth[]; // Do NOT add =null initializer
\r
37 * Construct a ChineseDateFormatSymbols for the default locale.
\r
40 public ChineseDateFormatSymbols() {
\r
41 this(ULocale.getDefault());
\r
45 * Construct a ChineseDateFormatSymbols for the provided locale.
\r
46 * @param locale the locale
\r
49 public ChineseDateFormatSymbols(Locale locale) {
\r
50 super(ChineseCalendar.class, ULocale.forLocale(locale));
\r
54 * Construct a ChineseDateFormatSymbols for the provided locale.
\r
55 * @param locale the locale
\r
58 public ChineseDateFormatSymbols(ULocale locale) {
\r
59 super(ChineseCalendar.class, locale);
\r
63 * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
\r
64 * @param cal the Calendar
\r
65 * @param locale the locale
\r
68 public ChineseDateFormatSymbols(Calendar cal, Locale locale) {
\r
69 super(cal==null?null:cal.getClass(), locale);
\r
73 * Construct a ChineseDateFormatSymbols for the provided calendar and locale.
\r
74 * @param cal the Calendar
\r
75 * @param locale the locale
\r
78 public ChineseDateFormatSymbols(Calendar cal, ULocale locale) {
\r
79 super(cal == null ? null : cal.getClass(), locale);
\r
86 public String getLeapMonth(int leap) {
\r
87 return isLeapMonth[leap];
\r
94 protected void initializeData(ULocale loc, CalendarData calData) {
\r
95 super.initializeData(loc, calData);
\r
96 isLeapMonth = calData.getStringArray("isLeapMonth");
\r
99 void initializeData(DateFormatSymbols dfs) {
\r
100 super.initializeData(dfs);
\r
101 if (dfs instanceof ChineseDateFormatSymbols) {
\r
102 this.isLeapMonth = ((ChineseDateFormatSymbols)dfs).isLeapMonth;
\r