Class ZoneMeta
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.ZoneMeta
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.
- Since:
- ICU 2.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intReturns the number of IDs in the equivalency group that includes the given ID.getAvailableIDs(TimeZone.SystemTimeZoneType type, String region, Integer rawOffset) Returns an immutable set of system IDs for the given conditions.static StringgetCanonicalCLDRID(String tzid) Return the canonical id for this tzid defined by CLDR, which might be the id itself.static Stringstatic StringgetCanonicalCountry(String tzid) Return the canonical country code for this tzid.static StringgetCanonicalCountry(String tzid, Output<Boolean> isPrimary) Return the canonical country code for this tzid.static StringgetCustomID(String id) Parse a custom time zone identifier and return the normalized custom time zone identifier for the given custom id string.static SimpleTimeZonegetCustomTimeZone(int offset) Creates a custom zone for the offsetstatic SimpleTimeZoneParse a custom time zone identifier and return a corresponding zone.static StringgetEquivalentID(String id, int index) Returns an ID in the equivalency group that includes the given ID.static StringReturns primary IANA zone ID for the input zone ID.static StringReturn the region code for this tzid.static StringgetShortID(String id) Returns the time zone's short ID for the zone ID.static StringgetShortID(TimeZone tz) Returns the time zone's short ID for the zone.static OlsonTimeZoneReturns a frozen OlsonTimeZone instance for the given ID.static UResourceBundleopenOlsonResource(UResourceBundle top, String id) Given an ID and the top-level resource of the zoneinfo resource, open the appropriate resource for the given time zone.
-
Constructor Details
-
ZoneMeta
public ZoneMeta()
-
-
Method Details
-
getAvailableIDs
public static Set<String> getAvailableIDs(TimeZone.SystemTimeZoneType type, String region, Integer rawOffset) Returns an immutable set of system IDs for the given conditions.- Parameters:
type- a system time zone type.region- a region, or null.rawOffset- a zone raw offset or null.- Returns:
- An immutable set of system IDs for the given conditions.
-
countEquivalentIDs
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- Returns:
- the number of zones in the equivalency group containing 'id', or zero if there are no equivalent zones.
- See Also:
-
getEquivalentID
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 IDindex- a value from 0 to n-1, where n is the value returned bycountEquivalentIDs(id)- Returns:
- the ID of the index-th zone in the equivalency group containing 'id', or an empty string if 'id' is not a valid system ID or 'index' is out of range
- See Also:
-
getCanonicalCLDRID
-
getCanonicalCLDRID
-
getIanaID
-
getRegion
-
getCanonicalCountry
-
getCanonicalCountry
Return the canonical country code for this tzid. If we have none, or if the time zone is not associated with a country or unknown, return null. When the given zone is the primary zone of the country, true is set to isPrimary. -
openOlsonResource
Given an ID and the top-level resource of the zoneinfo resource, open the appropriate resource for the given time zone. Dereference links if necessary.- Parameters:
top- the top level resource of the zoneinfo resource or null.id- zone id- Returns:
- the corresponding zone resource or null if not found
-
getSystemTimeZone
Returns a frozen OlsonTimeZone instance for the given ID. This method returns null when the given ID is unknown. -
getCustomTimeZone
Parse a custom time zone identifier and return a corresponding zone.- Parameters:
id- a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or GMT[+-]hh.- Returns:
- a frozen SimpleTimeZone with the given offset and no Daylight Savings Time, or null if the id cannot be parsed.
-
getCustomID
-
getCustomTimeZone
Creates a custom zone for the offset- Parameters:
offset- GMT offset in milliseconds- Returns:
- A custom TimeZone for the offset with normalized time zone id
-
getShortID
-
getShortID
-