Package org.eclipse.birt.core.data
Class DateFormatFactory
java.lang.Object
org.eclipse.birt.core.data.DateFormatFactory
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
DateFormatFactory
public DateFormatFactory()
-
-
Method Details
-
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
-