com.ibm.icu.text

Class ChineseDateFormat

public class ChineseDateFormat extends SimpleDateFormat

A concrete {@link DateFormat} for {@link com.ibm.icu.util.ChineseCalendar}. This class handles a ChineseCalendar-specific field, ChineseCalendar.IS_LEAP_MONTH. It also redefines the handling of two fields, ERA and YEAR. The former is displayed numerically, instead of symbolically, since it is the numeric cycle number in ChineseCalendar. The latter is numeric, as before, but has no special 2-digit Y2K behavior.

With regard to ChineseCalendar.IS_LEAP_MONTH, this class handles parsing specially. If no string symbol is found at all, this is taken as equivalent to an IS_LEAP_MONTH value of zero. This allows formats to display a special string (e.g., "*") for leap months, but no string for normal months.

Summary of field changes vs. {@link SimpleDateFormat}:

 Symbol   Meaning                 Presentation        Example
 ------   -------                 ------------        -------
 G        cycle                   (Number)            78
 y        year of cycle (1..60)   (Number)            17
 l        is leap month           (Text)              4637
 

Author: Alan Liu

See Also: ChineseCalendar ChineseDateFormatSymbols

UNKNOWN: ICU 2.0

Constructor Summary
ChineseDateFormat(String pattern, Locale locale)
Construct a ChineseDateFormat from a date format pattern and locale
ChineseDateFormat(String pattern, ULocale locale)
Construct a ChineseDateFormat from a date format pattern and locale
Method Summary
protected voidsubFormat(StringBuffer buf, char ch, int count, int beginOffset, FieldPosition pos, Calendar cal)
protected intsubParse(String text, int start, char ch, int count, boolean obeyCount, boolean allowNegative, boolean[] ambiguousYear, Calendar cal)

Constructor Detail

ChineseDateFormat

public ChineseDateFormat(String pattern, Locale locale)
Construct a ChineseDateFormat from a date format pattern and locale

Parameters: pattern the pattern locale the locale

UNKNOWN: ICU 2.0

ChineseDateFormat

public ChineseDateFormat(String pattern, ULocale locale)
Construct a ChineseDateFormat from a date format pattern and locale

Parameters: pattern the pattern locale the locale

UNKNOWN: ICU 3.2 This API might change or be removed in a future release.

Method Detail

subFormat

protected void subFormat(StringBuffer buf, char ch, int count, int beginOffset, FieldPosition pos, Calendar cal)

Deprecated: This API is ICU internal only.

UNKNOWN:

subParse

protected int subParse(String text, int start, char ch, int count, boolean obeyCount, boolean allowNegative, boolean[] ambiguousYear, Calendar cal)

UNKNOWN: ICU 2.0

Copyright (c) 2007 IBM Corporation and others.