public final class ZoneMeta extends Object
| Constructor and Description |
|---|
ZoneMeta() |
| Modifier and Type | Method and Description |
|---|---|
static int |
countEquivalentIDs(String id)
Returns the number of IDs in the equivalency group that
includes the given ID.
|
static Set<String> |
getAvailableIDs(TimeZone.SystemTimeZoneType type,
String region,
Integer rawOffset)
Returns an immutable set of system IDs for the given conditions.
|
static String |
getCanonicalCLDRID(String tzid)
Return the canonical id for this tzid defined by CLDR, which might be
the id itself.
|
static String |
getCanonicalCLDRID(TimeZone tz) |
static String |
getCanonicalCountry(String tzid)
Return the canonical country code for this tzid.
|
static String |
getCanonicalCountry(String tzid,
Output<Boolean> isPrimary)
Return the canonical country code for this tzid.
|
static String |
getCustomID(String id)
Parse a custom time zone identifier and return the normalized
custom time zone identifier for the given custom id string.
|
static SimpleTimeZone |
getCustomTimeZone(int offset)
Creates a custom zone for the offset
|
static SimpleTimeZone |
getCustomTimeZone(String id)
Parse a custom time zone identifier and return a corresponding zone.
|
static String |
getEquivalentID(String id,
int index)
Returns an ID in the equivalency group that includes the given
ID.
|
static String |
getRegion(String tzid)
Return the region code for this tzid.
|
static String |
getShortID(String id)
Returns the time zone's short ID for the zone ID.
|
static String |
getShortID(TimeZone tz)
Returns the time zone's short ID for the zone.
|
static OlsonTimeZone |
getSystemTimeZone(String id)
Returns a frozen OlsonTimeZone instance for the given ID.
|
static UResourceBundle |
openOlsonResource(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.
|
public static Set<String> getAvailableIDs(TimeZone.SystemTimeZoneType type, String region, Integer rawOffset)
type - a system time zone type.region - a region, or null.rawOffset - a zone raw offset or null.public static int countEquivalentIDs(String id)
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.
id - a system time zone IDZoneMeta.getEquivalentID(java.lang.String, int)public static String getEquivalentID(String id, int index)
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.
id - a system time zone IDindex - a value from 0 to n-1, where n is the value
returned by countEquivalentIDs(id)ZoneMeta.countEquivalentIDs(java.lang.String)public static String getCanonicalCLDRID(String tzid)
public static String getRegion(String tzid)
public static String getCanonicalCountry(String tzid)
public static String getCanonicalCountry(String tzid, Output<Boolean> isPrimary)
public static UResourceBundle openOlsonResource(UResourceBundle top, String id)
top - the top level resource of the zoneinfo resource or null.id - zone idpublic static OlsonTimeZone getSystemTimeZone(String id)
public static SimpleTimeZone getCustomTimeZone(String id)
id - a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.public static String getCustomID(String id)
id - a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.public static SimpleTimeZone getCustomTimeZone(int offset)
offset - GMT offset in millisecondspublic static String getShortID(TimeZone tz)
tz - the time zone