| java.lang.Object org.mortbay.util.DateCache
DateCache | public class DateCache (Code) | | Date Format Cache.
Computes String representations of Dates and caches
the results so that subsequent requests within the same minute
will be fast.
Only format strings that contain either "ss" or "ss.SSS" are
handled.
The timezone of the date may be included as an ID with the "zzz"
format string or as an offset with the "ZZZ" format string.
If consecutive calls are frequently very different, then this
may be a little slower than a normal DateFormat.
author: Kent Johnson author: Greg Wilkins (gregw) |
DateCache | public DateCache()(Code) | | Constructor.
Make a DateCache that will use a default format. The default format
generates the same results as Date.toString().
|
DateCache | public DateCache(String format)(Code) | | Constructor.
Make a DateCache that will use the given format
|
format | public synchronized String format(Date inDate)(Code) | | Format a date according to our stored formatter.
Parameters: inDate - Formatted date |
format | public synchronized String format(long inDate)(Code) | | Format a date according to our stored formatter.
Parameters: inDate - Formatted date |
format | public void format(long inDate, StringBuffer buffer)(Code) | | Format to string buffer.
Parameters: inDate - Date the format Parameters: buffer - StringBuffer |
setTimeZone | public void setTimeZone(TimeZone tz)(Code) | | Set the timezone.
Parameters: tz - TimeZone |
setTimeZoneID | public void setTimeZoneID(String timeZoneId)(Code) | | Set the timezone.
Parameters: timeZoneId - TimeZoneId the ID of the zone as used byTimeZone.getTimeZone(id) |
|
|