| java.lang.Object com.ibm.icu.impl.ZoneMeta
ZoneMeta | final public class ZoneMeta (Code) | | This class, not to be instantiated, implements the meta-data
missing from the underlying core JDK implementation of time zones.
There are two missing features: Obtaining a list of available zones
for a given country (as defined by the Olson database), and
obtaining a list of equivalent zones for a given zone (as defined
by Olson links).
This class uses a data class, ZoneMetaData, which is created by the
tool tz2icu.
author: Alan Liu since: ICU 2.8 |
Method Summary | |
public static synchronized int | countEquivalentIDs(String id) Returns the number of IDs in the equivalency group that
includes the given ID. | public static String | displayFallback(String tzid, String city, ULocale locale) Handle fallbacks for generic time (rules E.. | public static String | displayGMT(long value, ULocale locale) | public static String | displayRegion(String cityOrCountry, ULocale locale) | public static synchronized String[] | getAvailableIDs(String country) Returns a String array containing all system TimeZone IDs
associated with the given country. | public static synchronized String[] | getAvailableIDs() | public static synchronized String[] | getAvailableIDs(int offset) | public static String | getCanonicalCountry(String tzid) Return the canonical country code for this tzid. | public static String | getCanonicalID(String tzid) Return the canonical id for this tzid, which might be the id itself. | public static TimeZone | getCustomTimeZone(String id) Parse a custom time zone identifier and return a corresponding zone.
Parameters: id - a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, orGMT[+-]hh. | public static synchronized String | getEquivalentID(String id, int index) Returns an ID in the equivalency group that includes the given
ID. | public static TimeZone | getGMT() | public static String | getSingleCountry(String tzid) Return the country code if this is a 'single' time zone that can fallback to just
the country, otherwise return null. | public static TimeZone | getSystemTimeZone(String id) Lookup the given name in our system zone table. | public static String | getTZLocalizationInfo(ULocale locale, String format) Get the index'd tz datum for this locale. | public static ICUResourceBundle | openOlsonResource(String id) Given an ID, open the appropriate resource for the given time zone. |
HOURGMTREGION_FORMATFALLBACK_FORMATZONE_STRINGSFORWARD_SLASH | final public static String HOURGMTREGION_FORMATFALLBACK_FORMATZONE_STRINGSFORWARD_SLASH(Code) | | |
OLSON_ZONE_COUNT | static int OLSON_ZONE_COUNT(Code) | | |
OLSON_ZONE_START | static int OLSON_ZONE_START(Code) | | The Olson data is stored the "zoneinfo" resource bundle.
Sub-resources are organized into three ranges of data: Zones, final
rules, and country tables. There is also a meta-data resource
which has 3 integers: The number of zones, rules, and countries,
respectively. The country count includes the non-country 'Default'.
|
countEquivalentIDs | public static synchronized int countEquivalentIDs(String id)(Code) | | Returns the number of IDs in the equivalency group that
includes the given ID. An equivalency group contains zones
that behave identically to the given zone.
If there are no equivalent zones, then this method returns
0. This means either the given ID is not a valid zone, or it
is and there are no other equivalent zones.
Parameters: id - a system time zone ID the number of zones in the equivalency group containing'id', or zero if there are no equivalent zones. See Also: ZoneMeta.getEquivalentID |
getAvailableIDs | public static synchronized String[] getAvailableIDs(String country)(Code) | | Returns a String array containing all system TimeZone IDs
associated with the given country. These IDs may be passed to
TimeZone.getTimeZone() to construct the
corresponding TimeZone object.
Parameters: country - a two-letter ISO 3166 country code, or null to return zones not associated with any country an array of IDs for system TimeZones in the givencountry. If there are none, return a zero-length array. |
getAvailableIDs | public static synchronized String[] getAvailableIDs()(Code) | | |
getAvailableIDs | public static synchronized String[] getAvailableIDs(int offset)(Code) | | |
getCanonicalCountry | public static String getCanonicalCountry(String tzid)(Code) | | Return the canonical country code for this tzid. If we have none, or if the time zone
is not associated with a country, return null.
|
getCanonicalID | public static String getCanonicalID(String tzid)(Code) | | Return the canonical id for this tzid, which might be the id itself.
If there is no canonical id for it, return the passed-in id.
|
getCustomTimeZone | public static TimeZone getCustomTimeZone(String id)(Code) | | Parse a custom time zone identifier and return a corresponding zone.
Parameters: id - a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, orGMT[+-]hh. a newly created SimpleTimeZone with the given offset andno Daylight Savings Time, or null if the id cannot be parsed. |
getEquivalentID | public static synchronized String getEquivalentID(String id, int index)(Code) | | Returns an ID in the equivalency group that includes the given
ID. An equivalency group contains zones that behave
identically to the given zone.
The given index must be in the range 0..n-1, where n is the
value returned by countEquivalentIDs(id) . For
some value of 'index', the returned value will be equal to the
given id. If the given id is not a valid system time zone, or
if 'index' is out of range, then returns an empty string.
Parameters: id - a system time zone ID Parameters: index - a value from 0 to n-1, where n is the valuereturned by countEquivalentIDs(id) the ID of the index-th zone in the equivalency groupcontaining 'id', or an empty string if 'id' is not a validsystem ID or 'index' is out of range See Also: ZoneMeta.countEquivalentIDs |
getSingleCountry | public static String getSingleCountry(String tzid)(Code) | | Return the country code if this is a 'single' time zone that can fallback to just
the country, otherwise return null. (Note, one must also check the locale data
to see that there is a localization for the country in order to implement
tr#35 appendix J step 5.)
|
getSystemTimeZone | public static TimeZone getSystemTimeZone(String id)(Code) | | Lookup the given name in our system zone table. If found,
instantiate a new zone of that name and return it. If not
found, return 0.
|
getTZLocalizationInfo | public static String getTZLocalizationInfo(ULocale locale, String format)(Code) | | Get the index'd tz datum for this locale. Index must be one of the
values PREFIX, HOUR, GMT, REGION_FORMAT, FALLBACK_FORMAT
|
openOlsonResource | public static ICUResourceBundle openOlsonResource(String id)(Code) | | Given an ID, open the appropriate resource for the given time zone.
Dereference aliases if necessary.
Parameters: id - zone id Parameters: res - resource, which must be ready for use (initialized but not open) top-level resource bundle |
|
|