|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.DateCache
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.
Constructor Summary | |
DateCache()
Constructor. |
|
DateCache(java.lang.String format)
Constructor. |
|
DateCache(java.lang.String format,
java.text.DateFormatSymbols s)
|
|
DateCache(java.lang.String format,
java.util.Locale l)
|
Method Summary | |
java.lang.String |
format(java.util.Date inDate)
Format a date according to our stored formatter. |
java.lang.String |
format(long inDate)
Format a date according to our stored formatter. |
void |
format(long inDate,
java.lang.StringBuffer buffer)
Format to string buffer. |
java.text.SimpleDateFormat |
getFormat()
Get the format. |
java.lang.String |
getFormatString()
|
java.util.TimeZone |
getTimeZone()
|
void |
setTimeZone(java.util.TimeZone tz)
Set the timezone. |
void |
setTimeZoneID(java.lang.String timeZoneId)
Set the timezone. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DateCache()
public DateCache(java.lang.String format)
public DateCache(java.lang.String format, java.util.Locale l)
public DateCache(java.lang.String format, java.text.DateFormatSymbols s)
Method Detail |
public void setTimeZone(java.util.TimeZone tz)
tz
- TimeZonepublic java.util.TimeZone getTimeZone()
public void setTimeZoneID(java.lang.String timeZoneId)
timeZoneId
- TimeZoneId the ID of the zone as used by
TimeZone.getTimeZone(id)public java.lang.String format(java.util.Date inDate)
inDate
-
public java.lang.String format(long inDate)
inDate
-
public void format(long inDate, java.lang.StringBuffer buffer)
inDate
- Date the formatbuffer
- StringBufferpublic java.text.SimpleDateFormat getFormat()
public java.lang.String getFormatString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |