public abstract class AbstractWrappedDateFormat extends DateFormat
DateFormat and delegates mos
of its behavior to the delegate, except for the abstract method
format(Date, StringBuffer, FieldPosition) an
parse(String, ParsePosition) that can be overridden b
a subclass. For example the subclass EmptyDateFormat wraps a DateForma
but it parses the empty String and returns null where th
predefined Java DateFormats throw an exception.DateFormat.Field| Modifier and Type | Field and Description |
|---|---|
protected DateFormat |
delegate
Refers to the wrapped Format that is used to forwar
#format and #parseObject. |
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| Constructor and Description |
|---|
AbstractWrappedDateFormat(DateFormat delegate)
Constructs an AbstractWrappedDateFormat that wraps the given mandator
format.
|
| Modifier and Type | Method and Description |
|---|---|
abstract StringBuffer |
format(Date date,
StringBuffer toAppendTo,
FieldPosition pos) |
AttributedCharacterIterator |
formatToCharacterIterator(Object obj) |
Calendar |
getCalendar() |
NumberFormat |
getNumberFormat() |
TimeZone |
getTimeZone() |
boolean |
isLenient() |
abstract Date |
parse(String source,
ParsePosition pos) |
void |
setCalendar(Calendar newCalendar) |
void |
setLenient(boolean lenient) |
void |
setNumberFormat(NumberFormat newNumberFormat) |
void |
setTimeZone(TimeZone zone) |
clone, equals, format, format, getAvailableLocales, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getTimeInstance, getTimeInstance, getTimeInstance, hashCode, parse, parseObjectformat, parseObjectprotected final DateFormat delegate
#format and #parseObject.public AbstractWrappedDateFormat(DateFormat delegate)
delegate - the format that handles the standard casesNullPointerException - if delegate is nullpublic abstract StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
format in class DateFormatpublic abstract Date parse(String source, ParsePosition pos)
parse in class DateFormatpublic Calendar getCalendar()
getCalendar in class DateFormatpublic void setCalendar(Calendar newCalendar)
setCalendar in class DateFormatpublic NumberFormat getNumberFormat()
getNumberFormat in class DateFormatpublic void setNumberFormat(NumberFormat newNumberFormat)
setNumberFormat in class DateFormatpublic TimeZone getTimeZone()
getTimeZone in class DateFormatpublic void setTimeZone(TimeZone zone)
setTimeZone in class DateFormatpublic boolean isLenient()
isLenient in class DateFormatpublic void setLenient(boolean lenient)
setLenient in class DateFormatpublic AttributedCharacterIterator formatToCharacterIterator(Object obj)
formatToCharacterIterator in class FormatCopyright © 2009-2014 JGoodies Software GmbH. All Rights Reserved.