@Deprecated 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
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
ChineseDateFormat.Field
Deprecated.
ICU 50
|
DateFormat.BooleanAttribute, DateFormat.HourCycle
UFormat.SpanField
ABBR_GENERIC_TZ, ABBR_MONTH, ABBR_MONTH_DAY, ABBR_MONTH_WEEKDAY_DAY, ABBR_QUARTER, ABBR_SPECIFIC_TZ, ABBR_STANDALONE_MONTH, ABBR_UTC_TZ, ABBR_WEEKDAY, AM_PM_FIELD, AM_PM_MIDNIGHT_NOON_FIELD, calendar, DATE_FIELD, DATE_SKELETONS, DAY, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, DOW_LOCAL_FIELD, ERA_FIELD, EXTENDED_YEAR_FIELD, FIELD_COUNT, FLEXIBLE_DAY_PERIOD_FIELD, FRACTIONAL_SECOND_FIELD, FULL, GENERIC_TZ, HOUR, HOUR_GENERIC_TZ, HOUR_MINUTE, HOUR_MINUTE_GENERIC_TZ, HOUR_MINUTE_SECOND, HOUR_MINUTE_TZ, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR_TZ, HOUR0_FIELD, HOUR1_FIELD, HOUR24, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, JP_ERA_2019_JA, JP_ERA_2019_NARROW, JP_ERA_2019_ROOT, JULIAN_DAY_FIELD, LOCATION_TZ, LONG, MEDIUM, MILLISECOND_FIELD, MILLISECONDS_IN_DAY_FIELD, MINUTE, MINUTE_FIELD, MINUTE_SECOND, MONTH, MONTH_DAY, MONTH_FIELD, MONTH_WEEKDAY_DAY, NONE, NUM_MONTH, NUM_MONTH_DAY, NUM_MONTH_WEEKDAY_DAY, numberFormat, QUARTER, QUARTER_FIELD, RELATIVE, RELATIVE_DEFAULT, RELATIVE_FULL, RELATIVE_LONG, RELATIVE_MEDIUM, RELATIVE_SHORT, SECOND, SECOND_FIELD, SHORT, SPECIFIC_TZ, STANDALONE_DAY_FIELD, STANDALONE_MONTH, STANDALONE_MONTH_FIELD, STANDALONE_QUARTER_FIELD, TIME_SEPARATOR, TIME_SKELETONS, TIMEZONE_FIELD, TIMEZONE_GENERIC_FIELD, TIMEZONE_ISO_FIELD, TIMEZONE_ISO_LOCAL_FIELD, TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD, TIMEZONE_RFC_FIELD, TIMEZONE_SPECIAL_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, WEEKDAY, YEAR, YEAR_ABBR_MONTH, YEAR_ABBR_MONTH_DAY, YEAR_ABBR_MONTH_WEEKDAY_DAY, YEAR_ABBR_QUARTER, YEAR_FIELD, YEAR_MONTH, YEAR_MONTH_DAY, YEAR_MONTH_WEEKDAY_DAY, YEAR_NAME_FIELD, YEAR_NUM_MONTH, YEAR_NUM_MONTH_DAY, YEAR_NUM_MONTH_WEEKDAY_DAY, YEAR_QUARTER, YEAR_WOY_FIELD, ZONE_SKELETONS
Constructor and Description |
---|
ChineseDateFormat(String pattern,
Locale locale)
Deprecated.
ICU 50
|
ChineseDateFormat(String pattern,
String override,
ULocale locale)
Deprecated.
ICU 50
|
ChineseDateFormat(String pattern,
ULocale locale)
Deprecated.
ICU 50
|
Modifier and Type | Method and Description |
---|---|
protected DateFormat.Field |
patternCharToDateFormatField(char ch)
Deprecated.
ICU 50
|
protected void |
subFormat(StringBuffer buf,
char ch,
int count,
int beginOffset,
int fieldNum,
DisplayContext capitalizationContext,
FieldPosition pos,
char patternCharToOutput,
Calendar cal)
Deprecated.
This API is ICU internal only.
|
protected int |
subParse(String text,
int start,
char ch,
int count,
boolean obeyCount,
boolean allowNegative,
boolean[] ambiguousYear,
Calendar cal)
Deprecated.
ICU 50
|
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, getInstance, getNumberFormat, getSymbols, getTimeZoneFormat, hashCode, intervalFormatByAlgorithm, matchQuarterString, matchString, parse, set2DigitYearStart, setContext, setDateFormatSymbols, setNumberFormat, setNumberFormat, setTimeZoneFormat, subFormat, subFormat, toLocalizedPattern, toPattern, zeroPaddingNumber, zeroPaddingNumber
format, format, format, format, format, getAvailableLocales, getAvailableULocales, getBooleanAttribute, getCalendar, getContext, getDateInstance, getDateInstance, getDateInstance, getDateInstance, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getInstance, getInstance, getInstance, getInstanceForSkeleton, getInstanceForSkeleton, getInstanceForSkeleton, getInstanceForSkeleton, getInstanceForSkeleton, getNumberFormat, getPatternInstance, getPatternInstance, getPatternInstance, getPatternInstance, getPatternInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isCalendarLenient, isLenient, parse, parse, parseObject, setBooleanAttribute, setCalendar, setCalendarLenient, setLenient, setTimeZone
format, parseObject
@Deprecated public ChineseDateFormat(String pattern, Locale locale)
pattern
- the patternlocale
- the locale@Deprecated public ChineseDateFormat(String pattern, ULocale locale)
pattern
- the patternlocale
- the locale@Deprecated public ChineseDateFormat(String pattern, String override, ULocale locale)
pattern
- the patternoverride
- The override string. A numbering system override string can take one of the following forms:
1). If just a numbering system name is specified, it applies to all numeric fields in the date format pattern.
2). To specify an alternate numbering system on a field by field basis, use the field letters from the pattern
followed by an = sign, followed by the numbering system name. For example, to specify that just the year
be formatted using Hebrew digits, use the override "y=hebr". Multiple overrides can be specified in a single
string by separating them with a semi-colon. For example, the override string "m=thai;y=deva" would format using
Thai digits for the month and Devanagari digits for the year.locale
- the locale@Deprecated protected void subFormat(StringBuffer buf, char ch, int count, int beginOffset, int fieldNum, DisplayContext capitalizationContext, FieldPosition pos, char patternCharToOutput, Calendar cal)
subFormat
in class SimpleDateFormat
@Deprecated protected int subParse(String text, int start, char ch, int count, boolean obeyCount, boolean allowNegative, boolean[] ambiguousYear, Calendar cal)
cal
. Returns -start (for
ParsePosition) if failed. Subclasses may override this method to
modify or add parsing capabilities.subParse
in class SimpleDateFormat
text
- the time text to be parsed.start
- where to start parsing.ch
- the pattern character for the date field text to be parsed.count
- the count of a pattern character.obeyCount
- if true, then the next field directly abuts this one,
and we should use the count to know when to stop parsing.ambiguousYear
- return parameter; upon return, if ambiguousYear[0]
is true, then a two-digit year was parsed and may need to be readjusted.cal
with the parsed
value.@Deprecated protected DateFormat.Field patternCharToDateFormatField(char ch)
patternCharToDateFormatField
in class SimpleDateFormat
ch
- The pattern characterCopyright © 2016 Unicode, Inc. and others.