public interface ZoneNameProvider
SPI interface which encapsulates the timezone name repository.
Implementations are usually stateless and should normally not
try to manage a cache. Instead Time4J uses its own cache. The
fact that this interface is used per java.util.ServiceLoader
requires a concrete implementation to offer a public no-arg
constructor.
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
String |
getDisplayName(String zoneID,
NameStyle style,
Locale locale)
Returns the name of this timezone suitable for presentation to
users in given style and locale.
|
Set<String> |
getPreferredIDs(Locale locale,
boolean smart)
Gets a
Set of preferred timezone IDs for given
ISO-3166-country code. |
default String |
getStdFormatPattern(boolean zeroOffset,
Locale locale)
Obtains a typical localized format pattern in minute precision.
|
Set<String> getPreferredIDs(Locale locale, boolean smart)
Gets a Set of preferred timezone IDs for given
ISO-3166-country code.
This information is necessary to enable parsing of ambivalent timezone names.
locale - ISO-3166-alpha-2-country to be evaluatedsmart - if true then try to select zone ids such
that there is only one preferred id per zone nameString getDisplayName(String zoneID, NameStyle style, Locale locale)
Returns the name of this timezone suitable for presentation to users in given style and locale.
The first argument never contains the provider name as prefix. It is instead the part after the "~"-char (if not absent).
zoneID - timezone id (i.e. "Europe/London")style - name stylelocale - language settingjava.util.TimeZone.getDisplayName(boolean,int,Locale)default String getStdFormatPattern(boolean zeroOffset, Locale locale)
Obtains a typical localized format pattern in minute precision.
The character "±" represents a localized offset sign. And the double letters "hh" and "mm" represent localized digits of hour respective minute part of the offset. All other characters are to be interpreted as literals. Many locales return the format "GMT±hh:mm" (default).
zeroOffset - Is the offset to be formatted equal to UTC?locale - language settingCopyright © 2014–2017. All rights reserved.