Package dev.gmitch215.bytebox.time
Class ZoneRulesProvider
java.lang.Object
dev.gmitch215.bytebox.time.ZoneRulesProvider
Where
java.time gets its timezone rules.
This stands in for the provider a java.time implementation reads a compiled copy of the
timezone database through. The isolate already carries that database behind Intl, so the
rules are derived from what it reports; see IntlZoneRules. What that saves is the 108 KB the
compiled copy occupies plus the reader for it, neither of which becomes reachable.
An identifier is accepted if the platform accepts it, which includes the aliases a canonical list
leaves out: US/Eastern resolves even though getAvailableZoneIds() does not name it.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOnly ever reached by the compiler, when a class it rewrote declares this as its supertype. -
Method Summary
Modifier and TypeMethodDescriptionReturns every identifier the platform names, which excludes aliases it nonetheless accepts.static ZoneRulesThe rules for an identifier.static NavigableMap<String, ZoneRules> getVersions(String zoneId) The one version of the rules there is.static booleanrefresh()Returns false, because the platform's database changes only when the platform does.
-
Constructor Details
-
ZoneRulesProvider
protected ZoneRulesProvider()Only ever reached by the compiler, when a class it rewrote declares this as its supertype.
-
-
Method Details
-
getAvailableZoneIds
Returns every identifier the platform names, which excludes aliases it nonetheless accepts.- Returns:
- every identifier the platform names, which excludes aliases it nonetheless accepts
-
getRules
The rules for an identifier.- Parameters:
zoneId- an IANA identifier, such asEurope/LondonforCaching- whether the caller intends to hold on to the result, which makes no difference here because the platform's database changes only when the platform does- Returns:
- the rules
- Throws:
ZoneRulesException- when the platform does not recognise the identifier
-
getVersions
The one version of the rules there is.- Parameters:
zoneId- an IANA identifier- Returns:
- a map holding the single version the platform carries
- Throws:
ZoneRulesException- when the platform does not recognise the identifier
-
refresh
public static boolean refresh()Returns false, because the platform's database changes only when the platform does.- Returns:
- false, because the platform's database changes only when the platform does
-