public class TimeZoneGenericNames extends Object implements Serializable, Freezable<TimeZoneGenericNames>
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeZoneGenericNames.GenericMatchInfo
A class used for returning the name search result used by
TimeZoneGenericNames.find(String, int, EnumSet). |
static class |
TimeZoneGenericNames.GenericNameType
Generic name type enum
|
static class |
TimeZoneGenericNames.Pattern
Format pattern enum used for composing location and partial location names
|
| Constructor and Description |
|---|
TimeZoneGenericNames(ULocale locale,
TimeZoneNames tznames)
Constructs a
TimeZoneGenericNames with the given locale
and the TimeZoneNames. |
| Modifier and Type | Method and Description |
|---|---|
TimeZoneGenericNames |
cloneAsThawed()
Provides for the clone operation.
|
Collection<TimeZoneGenericNames.GenericMatchInfo> |
find(String text,
int start,
EnumSet<TimeZoneGenericNames.GenericNameType> genericTypes)
Returns a collection of time zone display name matches for the specified types in the
given text at the given offset.
|
TimeZoneGenericNames.GenericMatchInfo |
findBestMatch(String text,
int start,
EnumSet<TimeZoneGenericNames.GenericNameType> genericTypes)
Returns the best match of time zone display name for the specified types in the
given text at the given offset.
|
TimeZoneGenericNames |
freeze()
Freezes the object.
|
String |
getDisplayName(TimeZone tz,
TimeZoneGenericNames.GenericNameType type,
long date)
Returns the display name of the time zone for the given name type
at the given date, or null if the display name is not available.
|
String |
getGenericLocationName(String canonicalTzID)
Returns the generic location name for the given canonical time zone ID.
|
static TimeZoneGenericNames |
getInstance(ULocale locale)
The factory method of
TimeZoneGenericNames. |
boolean |
isFrozen()
Determines whether the object has been frozen or not.
|
TimeZoneGenericNames |
setFormatPattern(TimeZoneGenericNames.Pattern patType,
String patStr)
Sets the pattern string for the pattern type.
|
public TimeZoneGenericNames(ULocale locale, TimeZoneNames tznames)
TimeZoneGenericNames with the given locale
and the TimeZoneNames.locale - the localetznames - the TimeZoneNamespublic static TimeZoneGenericNames getInstance(ULocale locale)
TimeZoneGenericNames. This static method
returns a frozen instance of cached TimeZoneGenericNames.locale - the localeTimeZoneGenericNames.public String getDisplayName(TimeZone tz, TimeZoneGenericNames.GenericNameType type, long date)
tz - the time zonetype - the generic name type - see TimeZoneGenericNames.GenericNameTypedate - the datepublic String getGenericLocationName(String canonicalTzID)
canonicalTzID - the canonical time zone IDpublic TimeZoneGenericNames setFormatPattern(TimeZoneGenericNames.Pattern patType, String patStr)
patType - the pattern typepatStr - the pattern stringpublic TimeZoneGenericNames.GenericMatchInfo findBestMatch(String text, int start, EnumSet<TimeZoneGenericNames.GenericNameType> genericTypes)
text - the textstart - the start offset in the textgenericTypes - the set of name types.public Collection<TimeZoneGenericNames.GenericMatchInfo> find(String text, int start, EnumSet<TimeZoneGenericNames.GenericNameType> genericTypes)
text - the textstart - the start offset in the textgenericTypes - the set of name types.public boolean isFrozen()
isFrozen in interface Freezable<TimeZoneGenericNames>public TimeZoneGenericNames freeze()
freeze in interface Freezable<TimeZoneGenericNames>public TimeZoneGenericNames cloneAsThawed()
cloneAsThawed in interface Freezable<TimeZoneGenericNames>