Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Format
com.ibm.icu.text.UFormat
com.ibm.icu.text.DateFormat
com.ibm.icu.text.SimpleDateFormat
com.ibm.icu.text.ChineseDateFormat
public class ChineseDateFormat
extends SimpleDateFormat
DateFormat
for 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. SimpleDateFormat
:Symbol Meaning Presentation Example ------ ------- ------------ ------- G cycle (Number) 78 y year of cycle (1..60) (Number) 17 l is leap month (Text) 4637
ChineseCalendar
, ChineseDateFormatSymbols
Field Summary |
Constructor Summary | |
| |
|
Method Summary | |
protected void | |
protected int |
Methods inherited from class com.ibm.icu.text.SimpleDateFormat | |
applyLocalizedPattern , applyPattern , clone , equals , format , get2DigitYearStart , getDateFormatSymbols , getSymbols , hashCode , matchString , parse , set2DigitYearStart , setDateFormatSymbols , setNumberFormat , subFormat , subFormat , subParse , toLocalizedPattern , toPattern , zeroPaddingNumber , zeroPaddingNumber |
public ChineseDateFormat(String pattern, Locale locale)
Construct a ChineseDateFormat from a date format pattern and locale
- Parameters:
pattern
- the patternlocale
- the locale
public ChineseDateFormat(String pattern, ULocale locale)
Construct a ChineseDateFormat from a date format pattern and locale
- Parameters:
pattern
- the patternlocale
- the locale
protected void subFormat(StringBuffer buf, char ch, int count, int beginOffset, FieldPosition pos, Calendar cal)
- Overrides:
- subFormat in interface SimpleDateFormat
protected int subParse(String text, int start, char ch, int count, boolean obeyCount, boolean allowNegative, boolean[] ambiguousYear, Calendar cal)
- Overrides:
- subParse in interface SimpleDateFormat