Package com.ibm.icu.util

Examples of com.ibm.icu.util.TimeZoneRule


                return firstFinalTZTransition;
            } else if (ttidx < firstTZTransitionIdx) {
                return firstTZTransition;
            } else {
                // Create a TimeZoneTransition
                TimeZoneRule to = historicRules[getInt(typeData[ttidx + 1])];
                TimeZoneRule from = historicRules[getInt(typeData[ttidx])];
                long startTime = ((long)transitionTimes[ttidx+1])*Grego.MILLIS_PER_SECOND;

                // The transitions loaded from zoneinfo.res may contain non-transition data
                if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
                        && from.getDSTSavings() == to.getDSTSavings()) {
                    return getNextTransition(startTime, false);
                }

                return new TimeZoneTransition(startTime, from, to);
            }
View Full Code Here


                return null;
            } else if (ttidx == firstTZTransitionIdx) {
                return firstTZTransition;
            } else {
                // Create a TimeZoneTransition
                TimeZoneRule to = historicRules[getInt(typeData[ttidx])];
                TimeZoneRule from = historicRules[getInt(typeData[ttidx-1])];
                long startTime = ((long)transitionTimes[ttidx])*Grego.MILLIS_PER_SECOND;

                // The transitions loaded from zoneinfo.res may contain non-transition data
                if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
                        && from.getDSTSavings() == to.getDSTSavings()) {
                    return getPreviousTransition(startTime, false);
                }

                return new TimeZoneTransition(startTime, from, to);
            }
View Full Code Here

        }

        if (finalZone != null) {
            // Get the first occurrence of final rule starts
            long startTime = (long)finalMillis;
            TimeZoneRule firstFinalRule;
            if (finalZone.useDaylightTime()) {
                /*
                 * Note: When an OlsonTimeZone is constructed, we should set the final year
                 * as the start year of finalZone.  However, the boundary condition used for
                 * getting offset from finalZone has some problems.  So setting the start year
                 * in the finalZone will cause a problem.  For now, we do not set the valid
                 * start year when the construction time and create a clone and set the
                 * start year when extracting rules.
                 */
                finalZoneWithStartYear = (SimpleTimeZone)finalZone.clone();
                // finalYear is 1 year before the actual final year.
                // See the comment in the construction method.
                finalZoneWithStartYear.setStartYear(finalYear + 1);

                TimeZoneTransition tzt = finalZoneWithStartYear.getNextTransition(startTime, false);
                firstFinalRule  = tzt.getTo();
                startTime = tzt.getTime();
            } else {
                finalZoneWithStartYear = finalZone;
                firstFinalRule = new TimeArrayTimeZoneRule(finalZone.getID(),
                        finalZone.getRawOffset(), 0, new long[] {startTime}, DateTimeRule.UTC_TIME);
            }
            TimeZoneRule prevRule = null;
            if (transitionCount > 0) {
                prevRule = historicRules[getInt(typeData[transitionCount - 1])];
            }
            if (prevRule == null) {
                // No historic transitions, but only finalZone available
View Full Code Here

        return firstFinalTZTransition;
      } else if (ttidx < firstTZTransitionIdx) {
        return firstTZTransition;
      } else {
        // Create a TimeZoneTransition
        TimeZoneRule to = historicRules[getInt(typeMapData[ttidx + 1])];
        TimeZoneRule from = historicRules[getInt(typeMapData[ttidx])];
        long startTime = transitionTimes64[ttidx + 1] * Grego.MILLIS_PER_SECOND;

        // The transitions loaded from zoneinfo.res may contain non-transition data
        if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
            && from.getDSTSavings() == to.getDSTSavings()) {
          return getNextTransition(startTime, false);
        }

        return new TimeZoneTransition(startTime, from, to);
      }
View Full Code Here

        return null;
      } else if (ttidx == firstTZTransitionIdx) {
        return firstTZTransition;
      } else {
        // Create a TimeZoneTransition
        TimeZoneRule to = historicRules[getInt(typeMapData[ttidx])];
        TimeZoneRule from = historicRules[getInt(typeMapData[ttidx - 1])];
        long startTime = transitionTimes64[ttidx] * Grego.MILLIS_PER_SECOND;

        // The transitions loaded from zoneinfo.res may contain non-transition data
        if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
            && from.getDSTSavings() == to.getDSTSavings()) {
          return getPreviousTransition(startTime, false);
        }

        return new TimeZoneTransition(startTime, from, to);
      }
View Full Code Here

    }

    if (finalZone != null) {
      // Get the first occurrence of final rule starts
      long startTime = (long) finalStartMillis;
      TimeZoneRule firstFinalRule;
      if (finalZone.useDaylightTime()) {
        /*
         * Note: When an OlsonTimeZone is constructed, we should set the final year
         * as the start year of finalZone.  However, the boundary condition used for
         * getting offset from finalZone has some problems.  So setting the start year
         * in the finalZone will cause a problem.  For now, we do not set the valid
         * start year when the construction time and create a clone and set the
         * start year when extracting rules.
         */
        finalZoneWithStartYear = (SimpleTimeZone) finalZone.clone();
        finalZoneWithStartYear.setStartYear(finalStartYear);

        TimeZoneTransition tzt = finalZoneWithStartYear.getNextTransition(startTime, false);
        firstFinalRule = tzt.getTo();
        startTime = tzt.getTime();
      } else {
        finalZoneWithStartYear = finalZone;
        firstFinalRule = new TimeArrayTimeZoneRule(finalZone.getID(), finalZone.getRawOffset(), 0, new long[] { startTime },
            DateTimeRule.UTC_TIME);
      }
      TimeZoneRule prevRule = null;
      if (transitionCount > 0) {
        prevRule = historicRules[getInt(typeMapData[transitionCount - 1])];
      }
      if (prevRule == null) {
        // No historic transitions, but only finalZone available
View Full Code Here

                return firstFinalTZTransition;
            } else if (ttidx < firstTZTransitionIdx) {
                return firstTZTransition;
            } else {
                // Create a TimeZoneTransition
                TimeZoneRule to = historicRules[getInt(typeMapData[ttidx + 1])];
                TimeZoneRule from = historicRules[getInt(typeMapData[ttidx])];
                long startTime = transitionTimes64[ttidx+1] * Grego.MILLIS_PER_SECOND;

                // The transitions loaded from zoneinfo.res may contain non-transition data
                if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
                        && from.getDSTSavings() == to.getDSTSavings()) {
                    return getNextTransition(startTime, false);
                }

                return new TimeZoneTransition(startTime, from, to);
            }
View Full Code Here

                return null;
            } else if (ttidx == firstTZTransitionIdx) {
                return firstTZTransition;
            } else {
                // Create a TimeZoneTransition
                TimeZoneRule to = historicRules[getInt(typeMapData[ttidx])];
                TimeZoneRule from = historicRules[getInt(typeMapData[ttidx-1])];
                long startTime = transitionTimes64[ttidx] * Grego.MILLIS_PER_SECOND;

                // The transitions loaded from zoneinfo.res may contain non-transition data
                if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
                        && from.getDSTSavings() == to.getDSTSavings()) {
                    return getPreviousTransition(startTime, false);
                }

                return new TimeZoneTransition(startTime, from, to);
            }
View Full Code Here

        }

        if (finalZone != null) {
            // Get the first occurrence of final rule starts
            long startTime = (long)finalStartMillis;
            TimeZoneRule firstFinalRule;
            if (finalZone.useDaylightTime()) {
                /*
                 * Note: When an OlsonTimeZone is constructed, we should set the final year
                 * as the start year of finalZone.  However, the boundary condition used for
                 * getting offset from finalZone has some problems.  So setting the start year
                 * in the finalZone will cause a problem.  For now, we do not set the valid
                 * start year when the construction time and create a clone and set the
                 * start year when extracting rules.
                 */
                finalZoneWithStartYear = (SimpleTimeZone)finalZone.clone();
                finalZoneWithStartYear.setStartYear(finalStartYear);

                TimeZoneTransition tzt = finalZoneWithStartYear.getNextTransition(startTime, false);
                firstFinalRule  = tzt.getTo();
                startTime = tzt.getTime();
            } else {
                finalZoneWithStartYear = finalZone;
                firstFinalRule = new TimeArrayTimeZoneRule(finalZone.getID(),
                        finalZone.getRawOffset(), 0, new long[] {startTime}, DateTimeRule.UTC_TIME);
            }
            TimeZoneRule prevRule = null;
            if (transitionCount > 0) {
                prevRule = historicRules[getInt(typeMapData[transitionCount - 1])];
            }
            if (prevRule == null) {
                // No historic transitions, but only finalZone available
View Full Code Here

                return firstFinalTZTransition;
            } else if (ttidx < firstTZTransitionIdx) {
                return firstTZTransition;
            } else {
                // Create a TimeZoneTransition
                TimeZoneRule to = historicRules[getInt(typeData[ttidx + 1])];
                TimeZoneRule from = historicRules[getInt(typeData[ttidx])];
                long startTime = ((long)transitionTimes[ttidx+1])*Grego.MILLIS_PER_SECOND;

                // The transitions loaded from zoneinfo.res may contain non-transition data
                if (from.getName().equals(to.getName()) && from.getRawOffset() == to.getRawOffset()
                        && from.getDSTSavings() == to.getDSTSavings()) {
                    return getNextTransition(startTime, false);
                }

                return new TimeZoneTransition(startTime, from, to);
            }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.TimeZoneRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.