Class DateFormatFactory


  • public class DateFormatFactory
    extends java.lang.Object
    Manages per-thread storage of locale-specific DateFormat instances. Use this factory to obtain DateFormat instances to address two issues: (1) Reduce cost of on-the-fly construction of DateFormat instances. The factory uses cached instances whenever possible. (2) MT-safety issue related to use of shared DateFormat instances across threads
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.ibm.icu.text.DateFormat getDateInstance​(int dateStyle, com.ibm.icu.util.ULocale locale)
      Gets DateFormat instance allocated to the current thread for the given date style, timestyle and locale.
      static com.ibm.icu.text.DateFormat getDateTimeInstance​(int dateStyle, int timeStyle, com.ibm.icu.util.ULocale locale)
      Gets DateFormat instance allocated to the current thread for the given date style, timestyle and locale.
      static com.ibm.icu.text.SimpleDateFormat getPatternInstance​(org.eclipse.birt.core.data.PatternKey pattern)
      Gets DateFormat instance allocated to the current thread for the given pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateFormatFactory

        public DateFormatFactory()
    • Method Detail

      • getDateTimeInstance

        public static com.ibm.icu.text.DateFormat getDateTimeInstance​(int dateStyle,
                                                                      int timeStyle,
                                                                      com.ibm.icu.util.ULocale locale)
        Gets DateFormat instance allocated to the current thread for the given date style, timestyle and locale. Returned instance is safe to use
      • getDateInstance

        public static com.ibm.icu.text.DateFormat getDateInstance​(int dateStyle,
                                                                  com.ibm.icu.util.ULocale locale)
        Gets DateFormat instance allocated to the current thread for the given date style, timestyle and locale. Returned instance is safe to use
      • getPatternInstance

        public static com.ibm.icu.text.SimpleDateFormat getPatternInstance​(org.eclipse.birt.core.data.PatternKey pattern)
        Gets DateFormat instance allocated to the current thread for the given pattern. Returned instance is safe to use