Package java.text.spi
Class DateFormatProvider
java.lang.Object
java.util.spi.LocaleServiceProvider
java.text.spi.DateFormatProvider
public abstract class DateFormatProvider extends LocaleServiceProvider
This abstract class should be extended by service providers that provide
instances of
DateFormat.
Note that Android does not support user-supplied locale service providers.
- Since:
- 1.6
-
Constructor Summary
Constructors Modifier Constructor Description protectedDateFormatProvider()Default constructor, for use by subclasses. -
Method Summary
Modifier and Type Method Description abstract DateFormatgetDateInstance(int style, Locale locale)Returns an instance ofDateFormatthat formats dates in the given style for the given locale.abstract DateFormatgetDateTimeInstance(int dateStyle, int timeStyle, Locale locale)Returns an instance ofDateFormatthat formats dates and times in the given style for the given locale.abstract DateFormatgetTimeInstance(int style, Locale locale)Returns an instance ofDateFormatthat formats times in the given style for the given locale.Methods inherited from class java.util.spi.LocaleServiceProvider
getAvailableLocales
-
Constructor Details
-
DateFormatProvider
protected DateFormatProvider()Default constructor, for use by subclasses.
-
-
Method Details
-
getTimeInstance
Returns an instance ofDateFormatthat formats times in the given style for the given locale.- Parameters:
style- the given time formatting style.locale- the locale- Returns:
- an instance of
DateFormat - Throws:
NullPointerException- iflocale == nullIllegalArgumentException- if locale isn't one of the locales returned from getAvailableLocales().
-
getDateInstance
Returns an instance ofDateFormatthat formats dates in the given style for the given locale.- Parameters:
style- the given date formatting style.locale- the locale- Returns:
- an instance of
DateFormat - Throws:
NullPointerException- iflocale == nullIllegalArgumentException- if locale isn't one of the locales returned from getAvailableLocales().
-
getDateTimeInstance
Returns an instance ofDateFormatthat formats dates and times in the given style for the given locale.- Parameters:
dateStyle- the given date formatting style.timeStyle- the given time formatting style.locale- the locale- Returns:
- an instance of
DateFormat - Throws:
NullPointerException- iflocale == nullIllegalArgumentException- if locale isn't one of the locales returned from getAvailableLocales().
-