public final class WindowsZone extends Object implements Comparable<WindowsZone>, Serializable
Represents a windows timezone name which can be mapped to an IANA/Olson-ID using a territory information.
Example:
WindowsZone wzn = WindowsZone.of("Eastern Standard Time");
TZID winzone = wzn.resolveSmart(Locale.US);
System.out.println(winzone.canonical());
// output: WINDOWS~America/New_York
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(WindowsZone other)
The natural order is based on the lexicographical order of the
underlying names of windows zones.
|
boolean |
equals(Object obj) |
static Set<String> |
getAvailableNames()
Yields all available names of windows zones.
|
int |
hashCode() |
static WindowsZone |
of(String name)
Creates a name reference to a windows zone.
|
Set<TZID> |
resolve(Locale country)
Resolves this name reference to a set of various zone ids for given
country.
|
TZID |
resolveSmart(Locale country)
Resolves this name reference to at most one zone id for given
country.
|
String |
toString()
Returns the name of this windows zone reference.
|
public static Set<String> getAvailableNames()
Yields all available names of windows zones.
public static WindowsZone of(String name)
Creates a name reference to a windows zone.
name - standardized windows zone nameWindowsZoneIllegalArgumentException - if given name is not supportedgetAvailableNames()public String toString()
Returns the name of this windows zone reference.
public int compareTo(WindowsZone other)
The natural order is based on the lexicographical order of the underlying names of windows zones.
compareTo in interface Comparable<WindowsZone>other - another windows zone name referencepublic Set<TZID> resolve(Locale country)
Resolves this name reference to a set of various zone ids for given country.
country - country referencepublic TZID resolveSmart(Locale country)
Resolves this name reference to at most one zone id for given country.
Normally windows zones cannot be resolved to one single zone id,
but there is usually one preferred zone id based on the fact that
the daylight saving rules for this name and given country are often
the same for all belonging zone ids in the recent past. This method
tries its best to yield a result but applications have to check if
the result is null.
country - country referencenull if given country is not related to this nameCopyright © 2014–2016. All rights reserved.