src/share/classes/java/time/zone/ZoneRules.java

Print this page




  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.zone;
  63 
  64 import java.io.DataInput;
  65 import java.io.DataOutput;
  66 import java.io.IOException;
  67 import java.io.Serializable;
  68 import java.time.Duration;
  69 import java.time.Instant;
  70 import java.time.LocalDate;
  71 import java.time.LocalDateTime;
  72 import java.time.ZoneId;
  73 import java.time.ZoneOffset;
  74 import java.time.temporal.Year;
  75 import java.util.ArrayList;
  76 import java.util.Arrays;
  77 import java.util.Collections;
  78 import java.util.List;
  79 import java.util.Objects;
  80 import java.util.concurrent.ConcurrentHashMap;
  81 import java.util.concurrent.ConcurrentMap;
  82 
  83 /**
  84  * The rules defining how the zone offset varies for a single time-zone.
  85  * <p>
  86  * The rules model all the historic and future transitions for a time-zone.
  87  * {@link ZoneOffsetTransition} is used for known transitions, typically historic.
  88  * {@link ZoneOffsetTransitionRule} is used for future transitions that are based
  89  * on the result of an algorithm.
  90  * <p>
  91  * The rules are loaded via {@link ZoneRulesProvider} using a {@link ZoneId}.
  92  * The same rules may be shared internally between multiple zone IDs.
  93  * <p>
  94  * Serializing an instance of {@code ZoneRules} will store the entire set of rules.




  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.zone;
  63 
  64 import java.io.DataInput;
  65 import java.io.DataOutput;
  66 import java.io.IOException;
  67 import java.io.Serializable;
  68 import java.time.Duration;
  69 import java.time.Instant;
  70 import java.time.LocalDate;
  71 import java.time.LocalDateTime;
  72 import java.time.ZoneId;
  73 import java.time.ZoneOffset;
  74 import java.time.Year;
  75 import java.util.ArrayList;
  76 import java.util.Arrays;
  77 import java.util.Collections;
  78 import java.util.List;
  79 import java.util.Objects;
  80 import java.util.concurrent.ConcurrentHashMap;
  81 import java.util.concurrent.ConcurrentMap;
  82 
  83 /**
  84  * The rules defining how the zone offset varies for a single time-zone.
  85  * <p>
  86  * The rules model all the historic and future transitions for a time-zone.
  87  * {@link ZoneOffsetTransition} is used for known transitions, typically historic.
  88  * {@link ZoneOffsetTransitionRule} is used for future transitions that are based
  89  * on the result of an algorithm.
  90  * <p>
  91  * The rules are loaded via {@link ZoneRulesProvider} using a {@link ZoneId}.
  92  * The same rules may be shared internally between multiple zone IDs.
  93  * <p>
  94  * Serializing an instance of {@code ZoneRules} will store the entire set of rules.