# IcuZoneRulesProvider

public class **IcuZoneRulesProvider** extends [ZoneRulesProvider](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html)  
A ZoneRulesProvider that generates rules from ICU4J TimeZones.
This provider ensures that classes in `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/package-summary.html` use the same time zone information
as ICU4J.

### Public Constructor Summary

|---|---|
|   | [IcuZoneRulesProvider](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/IcuZoneRulesProvider.html#IcuZoneRulesProvider())() |

### Protected Method Summary

|---|---|
| [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html) | [provideRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/IcuZoneRulesProvider.html#provideRules(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId, boolean forCaching) SPI method to get the rules for the zone ID. |
| [NavigableMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NavigableMap.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html), [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html)\> | [provideVersions](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/IcuZoneRulesProvider.html#provideVersions(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId) SPI method to get the history of rules for the zone ID. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [provideZoneIds](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/IcuZoneRulesProvider.html#provideZoneIds())() SPI method to get the available zone IDs. |

### Inherited Method Summary

From class [java.time.zone.ZoneRulesProvider](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html)

|---|---|
| static [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [getAvailableZoneIds](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#getAvailableZoneIds())() Gets the set of available zone IDs. |
| static [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html) | [getRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#getRules(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId, boolean forCaching) Gets the rules for the zone ID. |
| static [NavigableMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NavigableMap.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html), [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html)\> | [getVersions](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#getVersions(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId) Gets the history of rules for the zone ID. |
| boolean | [provideRefresh](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#provideRefresh())() SPI method to refresh the rules from the underlying data provider. |
| abstract [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html) | [provideRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#provideRules(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId, boolean forCaching) SPI method to get the rules for the zone ID. |
| abstract [NavigableMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NavigableMap.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html), [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html)\> | [provideVersions](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#provideVersions(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId) SPI method to get the history of rules for the zone ID. |
| abstract [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [provideZoneIds](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#provideZoneIds())() SPI method to get the available zone IDs. |
| static boolean | [refresh](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#refresh())() Refreshes the rules from the underlying data provider. |
| static void | [registerProvider](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html#registerProvider(java.time.zone.ZoneRulesProvider))([ZoneRulesProvider](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRulesProvider.html) provider) Registers a zone rules provider. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**IcuZoneRulesProvider**
()

<br />

## Protected Methods

#### protected [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html)
**provideRules**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId, boolean forCaching)

SPI method to get the rules for the zone ID.


This loads the rules for the specified zone ID.
The provider implementation must validate that the zone ID is valid and
available, throwing a `ZoneRulesException` if it is not.
The result of the method in the valid case depends on the caching flag.


If the provider implementation is not dynamic, then the result of the
method must be the non-null set of rules selected by the ID.


If the provider implementation is dynamic, then the flag gives the option
of preventing the returned rules from being cached in `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/ZoneId.html`.
When the flag is true, the provider is permitted to return null, where
null will prevent the rules from being cached in `ZoneId`.
When the flag is false, the provider must return non-null rules.

##### Parameters

| zoneId | the zone ID as defined by `ZoneId`, not null |
| forCaching | whether the rules are being queried for caching, true if the returned rules will be cached by `ZoneId`, false if they will be returned to the user without being cached in `ZoneId` |
|---|---|

##### Returns

- the rules, null if `forCaching` is true and this is a dynamic provider that wants to prevent caching in `ZoneId`, otherwise not null

#### protected [NavigableMap](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/NavigableMap.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html), [ZoneRules](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/zone/ZoneRules.html)\>
**provideVersions**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) zoneId)

SPI method to get the history of rules for the zone ID.


This returns a map of historical rules keyed by a version string.
The exact meaning and format of the version is provider specific.
The version must follow lexicographical order, thus the returned map will
be order from the oldest known rules to the newest available rules.
The default 'TZDB' group uses version numbering consisting of the year
followed by a letter, such as '2009e' or '2012f'.


Implementations must provide a result for each valid zone ID, however
they do not have to provide a history of rules.
Thus the map will contain at least one element, and will only contain
more than one element if historical rule information is available.


The returned versions remain available and valid for the lifetime of the application.
A dynamic provider may increase the set of versions as more data becomes available.

##### Parameters

| zoneId | the zone ID as defined by `ZoneId`, not null |
|---|---|

##### Returns

- a modifiable copy of the history of the rules for the ID, sorted from oldest to newest, not null

#### protected [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\>
**provideZoneIds**
()

SPI method to get the available zone IDs.


This obtains the IDs that this `ZoneRulesProvider` provides.
A provider should provide data for at least one zone ID.


The returned zone IDs remain available and valid for the lifetime of the application.
A dynamic provider may increase the set of IDs as more data becomes available.

##### Returns

- the set of zone IDs being provided, not null