Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.util
Class FastDateFormat

    java.lang.Object
      org.jivesoftware.util.FastDateFormat

    public class FastDateFormat

extends Object

Similar to `SimpleDateFormat`, but faster and thread-safe. Only formatting is supported, but all patterns are compatible with SimpleDateFormat.

Note, this class is from the open source Tea project (http://sourceforge.net/projects/teatrove/).

Author:
  Brian S O'Neill

Field Summary
`static Object` | `FULL` Style pattern
`static Object` | `LONG` Style pattern
`static Object` | `MEDIUM` Style pattern
`static Object` | `SHORT` Style pattern

Method Summary
`String` | `format(Calendar calendar)`
`StringBuffer` | `format(Calendar calendar, StringBuffer buf)`
`String` | `format(Date date)`
`StringBuffer` | `format(Date date, StringBuffer buf)`
`static FastDateFormat` | `getDateInstance(Object style, TimeZone timeZone, Locale locale)`
`static FastDateFormat` | `getDateTimeInstance(Object dateStyle, Object timeStyle, TimeZone timeZone, Locale locale)`
`static FastDateFormat` | `getInstance()`
`static FastDateFormat` | `getInstance(String pattern)`
`static FastDateFormat` | `getInstance(String pattern, DateFormatSymbols symbols)`
`static FastDateFormat` | `getInstance(String pattern, Locale locale)`
`static FastDateFormat` | `getInstance(String pattern, TimeZone timeZone)`
`static FastDateFormat` | `getInstance(String pattern, TimeZone timeZone, Locale locale)`
`static FastDateFormat` | `getInstance(String pattern, TimeZone timeZone, Locale locale, DateFormatSymbols symbols)`
`Locale` | `getLocale()`
`int` | `getMaxLengthEstimate()` Returns an estimate for the maximum length date that this date formatter will produce.
`String` | `getPattern()`
`static FastDateFormat` | `getTimeInstance(Object style, TimeZone timeZone, Locale locale)`
`TimeZone` | `getTimeZone()` Returns the time zone used by this formatter, or null if time zone of formatted dates is used instead.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FULL

    public static final Object FULL

  Style pattern

### LONG

    public static final Object LONG

  Style pattern

### MEDIUM

    public static final Object MEDIUM

  Style pattern

### SHORT

    public static final Object SHORT

  Style pattern

Method Detail

### getInstance

    public static FastDateFormat getInstance()

### getInstance

    public static FastDateFormat getInstance(String pattern)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
  Throws:
    `IllegalArgumentException`

### getInstance

    public static FastDateFormat getInstance(String pattern,
                                             TimeZone timeZone)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
    `timeZone` - optional time zone, overrides time zone of formatted date
  Throws:
    `IllegalArgumentException`

### getInstance

    public static FastDateFormat getInstance(String pattern,
                                             Locale locale)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
    `locale` - optional locale, overrides system locale
  Throws:
    `IllegalArgumentException`

### getInstance

    public static FastDateFormat getInstance(String pattern,
                                             DateFormatSymbols symbols)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
    `symbols` - optional date format symbols, overrides symbols for system locale
  Throws:
    `IllegalArgumentException`

### getInstance

    public static FastDateFormat getInstance(String pattern,
                                             TimeZone timeZone,
                                             Locale locale)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
    `timeZone` - optional time zone, overrides time zone of formatted date
    `locale` - optional locale, overrides system locale
  Throws:
    `IllegalArgumentException`

### getInstance

    public static FastDateFormat getInstance(String pattern,
                                             TimeZone timeZone,
                                             Locale locale,
                                             DateFormatSymbols symbols)
                                      throws IllegalArgumentException

  Parameters:
    `pattern` - `SimpleDateFormat` compatible pattern
    `timeZone` - optional time zone, overrides time zone of formatted date
    `locale` - optional locale, overrides system locale
    `symbols` - optional date format symbols, overrides symbols for provided locale
  Throws:
    `IllegalArgumentException`

### getDateInstance

    public static FastDateFormat getDateInstance(Object style,
                                                 TimeZone timeZone,
                                                 Locale locale)
                                          throws IllegalArgumentException

  Parameters:
    `style` - date style: FULL, LONG, MEDIUM, or SHORT
    `timeZone` - optional time zone, overrides time zone of formatted date
    `locale` - optional locale, overrides system locale
  Throws:
    `IllegalArgumentException`

### getTimeInstance

    public static FastDateFormat getTimeInstance(Object style,
                                                 TimeZone timeZone,
                                                 Locale locale)
                                          throws IllegalArgumentException

  Parameters:
    `style` - time style: FULL, LONG, MEDIUM, or SHORT
    `timeZone` - optional time zone, overrides time zone of formatted date
    `locale` - optional locale, overrides system locale
  Throws:
    `IllegalArgumentException`

### getDateTimeInstance

    public static FastDateFormat getDateTimeInstance(Object dateStyle,
                                                     Object timeStyle,
                                                     TimeZone timeZone,
                                                     Locale locale)
                                              throws IllegalArgumentException

  Parameters:
    `dateStyle` - date style: FULL, LONG, MEDIUM, or SHORT
    `timeStyle` - time style: FULL, LONG, MEDIUM, or SHORT
    `timeZone` - optional time zone, overrides time zone of formatted date
    `locale` - optional locale, overrides system locale
  Throws:
    `IllegalArgumentException`

### format

    public String format(Date date)

### format

    public String format(Calendar calendar)

### format

    public StringBuffer format(Date date,
                               StringBuffer buf)

### format

    public StringBuffer format(Calendar calendar,
                               StringBuffer buf)

### getPattern

    public String getPattern()

### getTimeZone

    public TimeZone getTimeZone()

  Returns the time zone used by this formatter, or null if time zone of formatted dates is used instead.

### getLocale

    public Locale getLocale()

### getMaxLengthEstimate

    public int getMaxLengthEstimate()

  Returns an estimate for the maximum length date that this date formatter will produce. The actual formatted length will almost always be less than or equal to this amount.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.