< prev index next >

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

Print this page




 953      * <p>
 954      * The complete set of transitions for this rules instance is defined by this method
 955      * and {@link #getTransitions()}. This method returns instances of {@link ZoneOffsetTransitionRule}
 956      * that define an algorithm for when transitions will occur.
 957      * <p>
 958      * For any given {@code ZoneRules}, this list contains the transition rules for years
 959      * beyond those years that have been fully defined. These rules typically refer to future
 960      * daylight saving time rule changes.
 961      * <p>
 962      * If the zone defines daylight savings into the future, then the list will normally
 963      * be of size two and hold information about entering and exiting daylight savings.
 964      * If the zone does not have daylight savings, or information about future changes
 965      * is uncertain, then the list will be empty.
 966      * <p>
 967      * The list will be empty for fixed offset rules and for any time-zone where there is no
 968      * daylight saving time. The list will also be empty if the transition rules are unknown.
 969      *
 970      * @return an immutable list of transition rules, not null
 971      */
 972     public List<ZoneOffsetTransitionRule> getTransitionRules() {
 973         return Collections.unmodifiableList(Arrays.asList(lastRules));
 974     }
 975 
 976     /**
 977      * Checks if this set of rules equals another.
 978      * <p>
 979      * Two rule sets are equal if they will always result in the same output
 980      * for any given input instant or local date-time.
 981      * Rules from two different groups may return false even if they are in fact the same.
 982      * <p>
 983      * This definition should result in implementations comparing their entire state.
 984      *
 985      * @param otherRules  the other rules, null returns false
 986      * @return true if this rules is the same as that specified
 987      */
 988     @Override
 989     public boolean equals(Object otherRules) {
 990         if (this == otherRules) {
 991            return true;
 992         }
 993         if (otherRules instanceof ZoneRules) {




 953      * <p>
 954      * The complete set of transitions for this rules instance is defined by this method
 955      * and {@link #getTransitions()}. This method returns instances of {@link ZoneOffsetTransitionRule}
 956      * that define an algorithm for when transitions will occur.
 957      * <p>
 958      * For any given {@code ZoneRules}, this list contains the transition rules for years
 959      * beyond those years that have been fully defined. These rules typically refer to future
 960      * daylight saving time rule changes.
 961      * <p>
 962      * If the zone defines daylight savings into the future, then the list will normally
 963      * be of size two and hold information about entering and exiting daylight savings.
 964      * If the zone does not have daylight savings, or information about future changes
 965      * is uncertain, then the list will be empty.
 966      * <p>
 967      * The list will be empty for fixed offset rules and for any time-zone where there is no
 968      * daylight saving time. The list will also be empty if the transition rules are unknown.
 969      *
 970      * @return an immutable list of transition rules, not null
 971      */
 972     public List<ZoneOffsetTransitionRule> getTransitionRules() {
 973         return List.of(lastRules);
 974     }
 975 
 976     /**
 977      * Checks if this set of rules equals another.
 978      * <p>
 979      * Two rule sets are equal if they will always result in the same output
 980      * for any given input instant or local date-time.
 981      * Rules from two different groups may return false even if they are in fact the same.
 982      * <p>
 983      * This definition should result in implementations comparing their entire state.
 984      *
 985      * @param otherRules  the other rules, null returns false
 986      * @return true if this rules is the same as that specified
 987      */
 988     @Override
 989     public boolean equals(Object otherRules) {
 990         if (this == otherRules) {
 991            return true;
 992         }
 993         if (otherRules instanceof ZoneRules) {


< prev index next >