org.apache.catalina.util

Class FastDateFormat


public class FastDateFormat
extends DateFormat

Fast date formatter that caches recently formatted date information and uses it to avoid too-frequent calls to the underlying formatter. Note: breaks fieldPosition param of format(Date, StringBuffer, FieldPosition). If you care about the field position, call the underlying DateFormat directly.

Authors:
Stan Bailes
Alex Chaffee

Constructor Summary

FastDateFormat(DateFormat df)

Method Summary

StringBuffer
format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition)
Note: breaks functionality of fieldPosition param.
static void
main(String[] args)
Date
parse(String text, ParsePosition pos)

Constructor Details

FastDateFormat

public FastDateFormat(DateFormat df)

Method Details

format

public StringBuffer format(Date date,
                           StringBuffer toAppendTo,
                           FieldPosition fieldPosition)
Note: breaks functionality of fieldPosition param. Also: there's a bug in SimpleDateFormat with "S" and "SS", use "SSS" instead if you want a msec field.


main

public static void main(String[] args)


parse

public Date parse(String text,
                  ParsePosition pos)


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.