com.jgoodies.common.format
Class AbstractWrappedDateFormat
java.lang.Object
   java.text.Format
java.text.Format
       java.text.DateFormat
java.text.DateFormat
           com.jgoodies.common.format.AbstractWrappedDateFormat
com.jgoodies.common.format.AbstractWrappedDateFormat
- All Implemented Interfaces: 
- Serializable, Cloneable
- Direct Known Subclasses: 
- EmptyDateFormat
- public abstract class AbstractWrappedDateFormat 
- extends DateFormat
Reduces the effort required to write custom DateFormat implementations
 that retain the ability to iterate through Dates with the arrow keys
 in formatted text fields (using an appropriate DateFormatter).
 This class wraps a given DateFormat and delegates most
 of its behavior to the delegate, except for the abstract methods
 format(Date, StringBuffer, FieldPosition) and
 parse(String, ParsePosition) that can be overridden by
 a subclass. For example the subclass EmptyDateFormat wraps a DateFormat
 but it parses the empty String and returns null where the
 predefined Java DateFormats throw an exception.
- Version:
- $Revision: 1.1 $
- Author:
- Karsten Lentzsch
- See Also:
- Serialized Form
 
 
| Field Summary | 
| protected  DateFormat | delegateRefers to the wrapped Format that is used to forward
 #formatand#parseObject. | 
 
| Fields inherited from class java.text.DateFormat | 
| 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 | 
 
 
 
| Methods inherited from class java.text.DateFormat | 
| clone, equals, format, format, getAvailableLocales, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getTimeInstance, getTimeInstance, getTimeInstance, hashCode, parse, parseObject | 
 
 
 
delegate
protected final DateFormat delegate
- Refers to the wrapped Format that is used to forward
 #formatand#parseObject.
 
 
AbstractWrappedDateFormat
public AbstractWrappedDateFormat(DateFormat delegate)
- Constructs an AbstractWrappedDateFormat that wraps the given mandatory
 format.
 
- Parameters:
- delegate- the format that handles the standard cases
- Throws:
- NullPointerException- if- delegateis- null
 
format
public abstract StringBuffer format(Date date,
                                    StringBuffer toAppendTo,
                                    FieldPosition pos)
- 
- Specified by:
- formatin class- DateFormat
 
- 
 
parse
public abstract Date parse(String source,
                           ParsePosition pos)
- 
- Specified by:
- parsein class- DateFormat
 
- 
 
getCalendar
public Calendar getCalendar()
- 
- Overrides:
- getCalendarin class- DateFormat
 
- 
 
setCalendar
public void setCalendar(Calendar newCalendar)
- 
- Overrides:
- setCalendarin class- DateFormat
 
- 
 
getNumberFormat
public NumberFormat getNumberFormat()
- 
- Overrides:
- getNumberFormatin class- DateFormat
 
- 
 
setNumberFormat
public void setNumberFormat(NumberFormat newNumberFormat)
- 
- Overrides:
- setNumberFormatin class- DateFormat
 
- 
 
getTimeZone
public TimeZone getTimeZone()
- 
- Overrides:
- getTimeZonein class- DateFormat
 
- 
 
setTimeZone
public void setTimeZone(TimeZone zone)
- 
- Overrides:
- setTimeZonein class- DateFormat
 
- 
 
isLenient
public boolean isLenient()
- 
- Overrides:
- isLenientin class- DateFormat
 
- 
 
setLenient
public void setLenient(boolean lenient)
- 
- Overrides:
- setLenientin class- DateFormat
 
- 
 
formatToCharacterIterator
public AttributedCharacterIterator formatToCharacterIterator(Object obj)
- 
- Overrides:
- formatToCharacterIteratorin class- Format
 
- 
 
Copyright © 2009-2012 JGoodies Karsten Lentzsch. All Rights Reserved.