Class FastDateFormat

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

@Deprecated(forRemoval=true) public class FastDateFormat extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use instead thread-safe implementations provided by Java, such as DateTimeFormatter

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 Details

    • FULL

      public static final Object FULL
      Deprecated, for removal: This API element is subject to removal in a future version.
      Style pattern
    • LONG

      public static final Object LONG
      Deprecated, for removal: This API element is subject to removal in a future version.
      Style pattern
    • MEDIUM

      public static final Object MEDIUM
      Deprecated, for removal: This API element is subject to removal in a future version.
      Style pattern
    • SHORT

      public static final Object SHORT
      Deprecated, for removal: This API element is subject to removal in a future version.
      Style pattern
  • Method Details

    • getInstance

      public static FastDateFormat getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getInstance

      public static FastDateFormat getInstance(String pattern) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      pattern - SimpleDateFormat compatible pattern
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getInstance

      public static FastDateFormat getInstance(String pattern, TimeZone timeZone) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      pattern - SimpleDateFormat compatible pattern
      timeZone - optional time zone, overrides time zone of formatted date
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getInstance

      public static FastDateFormat getInstance(String pattern, Locale locale) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      pattern - SimpleDateFormat compatible pattern
      locale - optional locale, overrides system locale
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getInstance

      public static FastDateFormat getInstance(String pattern, DateFormatSymbols symbols) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      pattern - SimpleDateFormat compatible pattern
      symbols - optional date format symbols, overrides symbols for system locale
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getInstance

      public static FastDateFormat getInstance(String pattern, TimeZone timeZone, Locale locale) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      pattern - SimpleDateFormat compatible pattern
      timeZone - optional time zone, overrides time zone of formatted date
      locale - optional locale, overrides system locale
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getInstance

      public static FastDateFormat getInstance(String pattern, TimeZone timeZone, Locale locale, DateFormatSymbols symbols) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getDateInstance

      public static FastDateFormat getDateInstance(Object style, TimeZone timeZone, Locale locale) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getTimeInstance

      public static FastDateFormat getTimeInstance(Object style, TimeZone timeZone, Locale locale) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • getDateTimeInstance

      public static FastDateFormat getDateTimeInstance(Object dateStyle, Object timeStyle, TimeZone timeZone, Locale locale) throws IllegalArgumentException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Returns:
      the fast date format
      Throws:
      IllegalArgumentException
    • format

      public String format(Date date)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • format

      public String format(Calendar calendar)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • format

      public StringBuffer format(Date date, StringBuffer buf)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • format

      public StringBuffer format(Calendar calendar, StringBuffer buf)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPattern

      public String getPattern()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTimeZone

      public TimeZone getTimeZone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the time zone used by this formatter, or null if time zone of formatted dates is used instead.
      Returns:
      the time zone
    • getLocale

      public Locale getLocale()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMaxLengthEstimate

      public int getMaxLengthEstimate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Returns:
      an estimate of the maximum length