Package java.util.spi
Class TimeZoneNameProvider
java.lang.Object
java.util.spi.LocaleServiceProvider
java.util.spi.TimeZoneNameProvider
public abstract class TimeZoneNameProvider extends LocaleServiceProvider
This abstract class should be extended by service providers that provide
localized time zone names.
Note that Android does not support user-supplied locale service providers.
- Since:
- 1.6
-
Constructor Summary
Constructors Modifier Constructor Description protectedTimeZoneNameProvider()Default constructor, for use by subclasses. -
Method Summary
Modifier and Type Method Description abstract StringgetDisplayName(String id, boolean daylight, int style, Locale locale)Returns the localized name for the given time zone in the given locale.Methods inherited from class java.util.spi.LocaleServiceProvider
getAvailableLocales
-
Constructor Details
-
TimeZoneNameProvider
protected TimeZoneNameProvider()Default constructor, for use by subclasses.
-
-
Method Details
-
getDisplayName
Returns the localized name for the given time zone in the given locale.- Parameters:
id- the time zone iddaylight- true to return the name for daylight saving time.style- TimeZone.LONG or TimeZone.SHORTlocale- the locale- Returns:
- the readable time zone name, or null if it is unavailable
- Throws:
NullPointerException- ifid == null || locale == nullIllegalArgumentException- if locale is not available or style is invalid
-