| java.lang.Object org.apache.mailet.dates.SynchronizedDateFormat
All known Subclasses: org.apache.mailet.dates.RFC2980DateFormat, org.apache.mailet.dates.RFC822DateFormat,
SynchronizedDateFormat | public class SynchronizedDateFormat implements SimplifiedDateFormat(Code) | | This class is designed to be a synchronized wrapper for a
java.text.DateFormat subclass. In general,
these subclasses (most notably the java.text.SimpleDateFormat
classes are not thread safe, so we need to synchronize on the
internal DateFormat for all delegated calls.
|
Method Summary | |
public boolean | equals(Object obj) | public String | format(Date d) SimpleDateFormat will handle most of this for us, but we
want to ensure thread safety, so we wrap the call in a
synchronized block. | public TimeZone | getTimeZone() Gets the time zone. | public int | hashCode() | public boolean | isLenient() Tell whether date/time parsing is to be lenient. | public Date | parse(String source) Parses text from the beginning of the given string to produce a date.
The method may not use the entire text of the given string.
This method is designed to be thread safe, so we wrap our delegated
parse method in an appropriate synchronized block.
Parameters: source - A String whose beginning should be parsed. | public void | setLenient(boolean lenient) Specify whether or not date/time parsing is to be lenient. | public void | setTimeZone(TimeZone zone) Sets the time zone of this SynchronizedDateFormat object. |
SynchronizedDateFormat | public SynchronizedDateFormat(String pattern, Locale locale)(Code) | | Public constructor that mimics that of SimpleDateFormat. See
java.text.SimpleDateFormat for more details.
Parameters: pattern - the pattern that defines this DateFormat Parameters: locale - the locale |
SynchronizedDateFormat | protected SynchronizedDateFormat(DateFormat theDateFormat)(Code) | | Wrapper method to allow child classes to synchronize a preexisting
DateFormat.
TODO: Investigate replacing this with a factory method.
Parameters: the - DateFormat to synchronize |
equals | public boolean equals(Object obj)(Code) | | Overrides equals
|
format | public String format(Date d)(Code) | | SimpleDateFormat will handle most of this for us, but we
want to ensure thread safety, so we wrap the call in a
synchronized block.
java.lang.String Parameters: d - Date |
getTimeZone | public TimeZone getTimeZone()(Code) | | Gets the time zone.
the time zone associated with this SynchronizedDateFormat. |
hashCode | public int hashCode()(Code) | | Overrides hashCode
|
isLenient | public boolean isLenient()(Code) | | Tell whether date/time parsing is to be lenient.
whether this SynchronizedDateFormat is lenient. |
parse | public Date parse(String source) throws ParseException(Code) | | Parses text from the beginning of the given string to produce a date.
The method may not use the entire text of the given string.
This method is designed to be thread safe, so we wrap our delegated
parse method in an appropriate synchronized block.
Parameters: source - A String whose beginning should be parsed. A Date parsed from the string. throws: ParseException - if the beginning of the specified stringcannot be parsed. |
setLenient | public void setLenient(boolean lenient)(Code) | | Specify whether or not date/time parsing is to be lenient. With
lenient parsing, the parser may use heuristics to interpret inputs that
do not precisely match this object's format. With strict parsing,
inputs must match this object's format.
Parameters: lenient - when true, parsing is lenient See Also: java.util.Calendar.setLenient |
setTimeZone | public void setTimeZone(TimeZone zone)(Code) | | Sets the time zone of this SynchronizedDateFormat object.
Parameters: zone - the given new time zone. |
|
|