home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / util / SimpleTimeZone.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  10.0 KB  |  608 lines

  1. package java.util;
  2.  
  3. import java.io.IOException;
  4. import java.io.ObjectInputStream;
  5. import java.io.ObjectOutputStream;
  6. import sun.util.calendar.BaseCalendar;
  7. import sun.util.calendar.CalendarSystem;
  8. import sun.util.calendar.CalendarUtils;
  9. import sun.util.calendar.Gregorian;
  10.  
  11. public class SimpleTimeZone extends TimeZone {
  12.    private int startMonth;
  13.    private int startDay;
  14.    private int startDayOfWeek;
  15.    private int startTime;
  16.    private int startTimeMode;
  17.    private int endMonth;
  18.    private int endDay;
  19.    private int endDayOfWeek;
  20.    private int endTime;
  21.    private int endTimeMode;
  22.    private int startYear;
  23.    private int rawOffset;
  24.    private boolean useDaylight;
  25.    private static final int millisPerHour = 3600000;
  26.    private static final int millisPerDay = 86400000;
  27.    private final byte[] monthLength;
  28.    private static final byte[] staticMonthLength = new byte[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  29.    private static final byte[] staticLeapMonthLength = new byte[]{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  30.    private int startMode;
  31.    private int endMode;
  32.    private int dstSavings;
  33.    private static final Gregorian gcal = CalendarSystem.getGregorianCalendar();
  34.    private transient long cacheYear;
  35.    private transient long cacheStart;
  36.    private transient long cacheEnd;
  37.    private static final int DOM_MODE = 1;
  38.    private static final int DOW_IN_MONTH_MODE = 2;
  39.    private static final int DOW_GE_DOM_MODE = 3;
  40.    private static final int DOW_LE_DOM_MODE = 4;
  41.    public static final int WALL_TIME = 0;
  42.    public static final int STANDARD_TIME = 1;
  43.    public static final int UTC_TIME = 2;
  44.    static final long serialVersionUID = -403250971215465050L;
  45.    static final int currentSerialVersion = 2;
  46.    private int serialVersionOnStream;
  47.  
  48.    public SimpleTimeZone(int var1, String var2) {
  49.       this.useDaylight = false;
  50.       this.monthLength = staticMonthLength;
  51.       this.serialVersionOnStream = 2;
  52.       this.rawOffset = var1;
  53.       this.setID(var2);
  54.       this.dstSavings = 3600000;
  55.    }
  56.  
  57.    public SimpleTimeZone(int var1, String var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10) {
  58.       this(var1, var2, var3, var4, var5, var6, 0, var7, var8, var9, var10, 0, 3600000);
  59.    }
  60.  
  61.    public SimpleTimeZone(int var1, String var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11) {
  62.       this(var1, var2, var3, var4, var5, var6, 0, var7, var8, var9, var10, 0, var11);
  63.    }
  64.  
  65.    public SimpleTimeZone(int var1, String var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13) {
  66.       this.useDaylight = false;
  67.       this.monthLength = staticMonthLength;
  68.       this.serialVersionOnStream = 2;
  69.       this.setID(var2);
  70.       this.rawOffset = var1;
  71.       this.startMonth = var3;
  72.       this.startDay = var4;
  73.       this.startDayOfWeek = var5;
  74.       this.startTime = var6;
  75.       this.startTimeMode = var7;
  76.       this.endMonth = var8;
  77.       this.endDay = var9;
  78.       this.endDayOfWeek = var10;
  79.       this.endTime = var11;
  80.       this.endTimeMode = var12;
  81.       this.dstSavings = var13;
  82.       this.decodeRules();
  83.       if (var13 <= 0) {
  84.          throw new IllegalArgumentException("Illegal daylight saving value: " + var13);
  85.       }
  86.    }
  87.  
  88.    public void setStartYear(int var1) {
  89.       this.startYear = var1;
  90.       this.invalidateCache();
  91.    }
  92.  
  93.    public void setStartRule(int var1, int var2, int var3, int var4) {
  94.       this.startMonth = var1;
  95.       this.startDay = var2;
  96.       this.startDayOfWeek = var3;
  97.       this.startTime = var4;
  98.       this.startTimeMode = 0;
  99.       this.decodeStartRule();
  100.       this.invalidateCache();
  101.    }
  102.  
  103.    public void setStartRule(int var1, int var2, int var3) {
  104.       this.setStartRule(var1, var2, 0, var3);
  105.    }
  106.  
  107.    public void setStartRule(int var1, int var2, int var3, int var4, boolean var5) {
  108.       if (var5) {
  109.          this.setStartRule(var1, var2, -var3, var4);
  110.       } else {
  111.          this.setStartRule(var1, -var2, -var3, var4);
  112.       }
  113.  
  114.    }
  115.  
  116.    public void setEndRule(int var1, int var2, int var3, int var4) {
  117.       this.endMonth = var1;
  118.       this.endDay = var2;
  119.       this.endDayOfWeek = var3;
  120.       this.endTime = var4;
  121.       this.endTimeMode = 0;
  122.       this.decodeEndRule();
  123.       this.invalidateCache();
  124.    }
  125.  
  126.    public void setEndRule(int var1, int var2, int var3) {
  127.       this.setEndRule(var1, var2, 0, var3);
  128.    }
  129.  
  130.    public void setEndRule(int var1, int var2, int var3, int var4, boolean var5) {
  131.       if (var5) {
  132.          this.setEndRule(var1, var2, -var3, var4);
  133.       } else {
  134.          this.setEndRule(var1, -var2, -var3, var4);
  135.       }
  136.  
  137.    }
  138.  
  139.    public int getOffset(long var1) {
  140.       return this.getOffsets(var1, (int[])null);
  141.    }
  142.  
  143.    int getOffsets(long var1, int[] var3) {
  144.       int var4 = this.rawOffset;
  145.       if (this.useDaylight) {
  146.          label44: {
  147.             synchronized(this) {
  148.                if (this.cacheStart != 0L && var1 >= this.cacheStart && var1 < this.cacheEnd) {
  149.                   var4 += this.dstSavings;
  150.                   break label44;
  151.                }
  152.             }
  153.  
  154.             Object var5 = var1 >= -12219292800000L ? gcal : (BaseCalendar)CalendarSystem.forName("julian");
  155.             BaseCalendar.Date var6 = (BaseCalendar.Date)((BaseCalendar)var5).newCalendarDate(TimeZone.NO_TIMEZONE);
  156.             ((BaseCalendar)var5).getCalendarDate(var1 + (long)this.rawOffset, var6);
  157.             int var7 = var6.getNormalizedYear();
  158.             if (var7 >= this.startYear) {
  159.                var6.setTimeOfDay(0, 0, 0, 0);
  160.                var4 = this.getOffset((BaseCalendar)var5, var6, var7, var1);
  161.             }
  162.          }
  163.       }
  164.  
  165.       if (var3 != null) {
  166.          var3[0] = this.rawOffset;
  167.          var3[1] = var4 - this.rawOffset;
  168.       }
  169.  
  170.       return var4;
  171.    }
  172.  
  173.    public int getOffset(int var1, int var2, int var3, int var4, int var5, int var6) {
  174.       if (var1 != 1 && var1 != 0) {
  175.          throw new IllegalArgumentException("Illegal era " + var1);
  176.       } else {
  177.          int var7 = var2;
  178.          if (var1 == 0) {
  179.             var7 = 1 - var2;
  180.          }
  181.  
  182.          if (var7 >= 292278994) {
  183.             var7 = 2800 + var7 % 2800;
  184.          } else if (var7 <= -292269054) {
  185.             var7 = (int)CalendarUtils.mod((long)var7, 28L);
  186.          }
  187.  
  188.          int var8 = var3 + 1;
  189.          Object var9 = gcal;
  190.          BaseCalendar.Date var10 = (BaseCalendar.Date)((BaseCalendar)var9).newCalendarDate(TimeZone.NO_TIMEZONE);
  191.          var10.setDate(var7, var8, var4);
  192.          long var11 = ((BaseCalendar)var9).getTime(var10);
  193.          var11 += (long)(var6 - this.rawOffset);
  194.          if (var11 < -12219292800000L) {
  195.             var9 = (BaseCalendar)CalendarSystem.forName("julian");
  196.             var10 = (BaseCalendar.Date)((BaseCalendar)var9).newCalendarDate(TimeZone.NO_TIMEZONE);
  197.             var10.setNormalizedDate(var7, var8, var4);
  198.             var11 = ((BaseCalendar)var9).getTime(var10) + (long)var6 - (long)this.rawOffset;
  199.          }
  200.  
  201.          if (var10.getNormalizedYear() == var7 && var10.getMonth() == var8 && var10.getDayOfMonth() == var4 && var5 >= 1 && var5 <= 7 && var6 >= 0 && var6 < 86400000) {
  202.             return this.useDaylight && var2 >= this.startYear && var1 == 1 ? this.getOffset((BaseCalendar)var9, var10, var7, var11) : this.rawOffset;
  203.          } else {
  204.             throw new IllegalArgumentException();
  205.          }
  206.       }
  207.    }
  208.  
  209.    private int getOffset(BaseCalendar var1, BaseCalendar.Date var2, int var3, long var4) {
  210.       synchronized(this) {
  211.          if (this.cacheStart != 0L) {
  212.             if (var4 >= this.cacheStart && var4 < this.cacheEnd) {
  213.                return this.rawOffset + this.dstSavings;
  214.             }
  215.  
  216.             if ((long)var3 == this.cacheYear) {
  217.                return this.rawOffset;
  218.             }
  219.          }
  220.       }
  221.  
  222.       long var6 = this.getStart(var1, var2, var3);
  223.       long var8 = this.getEnd(var1, var2, var3);
  224.       int var10 = this.rawOffset;
  225.       if (var6 <= var8) {
  226.          if (var4 >= var6 && var4 < var8) {
  227.             var10 += this.dstSavings;
  228.          }
  229.  
  230.          synchronized(this) {
  231.             this.cacheYear = (long)var3;
  232.             this.cacheStart = var6;
  233.             this.cacheEnd = var8;
  234.          }
  235.       } else {
  236.          if (var4 < var8) {
  237.             var6 = this.getStart(var1, var2, var3 - 1);
  238.             if (var4 >= var6) {
  239.                var10 += this.dstSavings;
  240.             }
  241.          } else if (var4 >= var6) {
  242.             var8 = this.getEnd(var1, var2, var3 + 1);
  243.             if (var4 < var8) {
  244.                var10 += this.dstSavings;
  245.             }
  246.          }
  247.  
  248.          if (var6 <= var8) {
  249.             synchronized(this) {
  250.                this.cacheYear = (long)this.startYear - 1L;
  251.                this.cacheStart = var6;
  252.                this.cacheEnd = var8;
  253.             }
  254.          }
  255.       }
  256.  
  257.       return var10;
  258.    }
  259.  
  260.    private long getStart(BaseCalendar var1, BaseCalendar.Date var2, int var3) {
  261.       int var4 = this.startTime;
  262.       if (this.startTimeMode != 2) {
  263.          var4 -= this.rawOffset;
  264.       }
  265.  
  266.       return this.getTransition(var1, var2, this.startMode, var3, this.startMonth, this.startDay, this.startDayOfWeek, var4);
  267.    }
  268.  
  269.    private long getEnd(BaseCalendar var1, BaseCalendar.Date var2, int var3) {
  270.       int var4 = this.endTime;
  271.       if (this.startTimeMode != 2) {
  272.          var4 -= this.rawOffset;
  273.       }
  274.  
  275.       if (this.startTimeMode == 0) {
  276.          var4 -= this.dstSavings;
  277.       }
  278.  
  279.       return this.getTransition(var1, var2, this.endMode, var3, this.endMonth, this.endDay, this.endDayOfWeek, var4);
  280.    }
  281.  
  282.    private long getTransition(BaseCalendar var1, BaseCalendar.Date var2, int var3, int var4, int var5, int var6, int var7, int var8) {
  283.       var2.setNormalizedYear(var4);
  284.       var2.setMonth(var5 + 1);
  285.       switch (var3) {
  286.          case 1:
  287.             var2.setDayOfMonth(var6);
  288.             break;
  289.          case 2:
  290.             var2.setDayOfMonth(1);
  291.             if (var6 < 0) {
  292.                var2.setDayOfMonth(var1.getMonthLength(var2));
  293.             }
  294.  
  295.             var2 = (BaseCalendar.Date)var1.getNthDayOfWeek(var6, var7, var2);
  296.             break;
  297.          case 3:
  298.             var2.setDayOfMonth(var6);
  299.             var2 = (BaseCalendar.Date)var1.getNthDayOfWeek(1, var7, var2);
  300.             break;
  301.          case 4:
  302.             var2.setDayOfMonth(var6);
  303.             var2 = (BaseCalendar.Date)var1.getNthDayOfWeek(-1, var7, var2);
  304.       }
  305.  
  306.       return var1.getTime(var2) + (long)var8;
  307.    }
  308.  
  309.    public int getRawOffset() {
  310.       return this.rawOffset;
  311.    }
  312.  
  313.    public void setRawOffset(int var1) {
  314.       this.rawOffset = var1;
  315.    }
  316.  
  317.    public void setDSTSavings(int var1) {
  318.       if (var1 <= 0) {
  319.          throw new IllegalArgumentException("Illegal daylight saving value: " + var1);
  320.       } else {
  321.          this.dstSavings = var1;
  322.       }
  323.    }
  324.  
  325.    public int getDSTSavings() {
  326.       return this.useDaylight ? this.dstSavings : 0;
  327.    }
  328.  
  329.    public boolean useDaylightTime() {
  330.       return this.useDaylight;
  331.    }
  332.  
  333.    public boolean inDaylightTime(Date var1) {
  334.       return this.getOffset(var1.getTime()) != this.rawOffset;
  335.    }
  336.  
  337.    public Object clone() {
  338.       return super.clone();
  339.    }
  340.  
  341.    public synchronized int hashCode() {
  342.       return this.startMonth ^ this.startDay ^ this.startDayOfWeek ^ this.startTime ^ this.endMonth ^ this.endDay ^ this.endDayOfWeek ^ this.endTime ^ this.rawOffset;
  343.    }
  344.  
  345.    public boolean equals(Object var1) {
  346.       if (this == var1) {
  347.          return true;
  348.       } else if (!(var1 instanceof SimpleTimeZone)) {
  349.          return false;
  350.       } else {
  351.          SimpleTimeZone var2 = (SimpleTimeZone)var1;
  352.          return this.getID().equals(var2.getID()) && this.hasSameRules(var2);
  353.       }
  354.    }
  355.  
  356.    public boolean hasSameRules(TimeZone var1) {
  357.       if (this == var1) {
  358.          return true;
  359.       } else if (!(var1 instanceof SimpleTimeZone)) {
  360.          return false;
  361.       } else {
  362.          SimpleTimeZone var2 = (SimpleTimeZone)var1;
  363.          return this.rawOffset == var2.rawOffset && this.useDaylight == var2.useDaylight && (!this.useDaylight || this.dstSavings == var2.dstSavings && this.startMode == var2.startMode && this.startMonth == var2.startMonth && this.startDay == var2.startDay && this.startDayOfWeek == var2.startDayOfWeek && this.startTime == var2.startTime && this.startTimeMode == var2.startTimeMode && this.endMode == var2.endMode && this.endMonth == var2.endMonth && this.endDay == var2.endDay && this.endDayOfWeek == var2.endDayOfWeek && this.endTime == var2.endTime && this.endTimeMode == var2.endTimeMode && this.startYear == var2.startYear);
  364.       }
  365.    }
  366.  
  367.    public String toString() {
  368.       return this.getClass().getName() + "[id=" + this.getID() + ",offset=" + this.rawOffset + ",dstSavings=" + this.dstSavings + ",useDaylight=" + this.useDaylight + ",startYear=" + this.startYear + ",startMode=" + this.startMode + ",startMonth=" + this.startMonth + ",startDay=" + this.startDay + ",startDayOfWeek=" + this.startDayOfWeek + ",startTime=" + this.startTime + ",startTimeMode=" + this.startTimeMode + ",endMode=" + this.endMode + ",endMonth=" + this.endMonth + ",endDay=" + this.endDay + ",endDayOfWeek=" + this.endDayOfWeek + ",endTime=" + this.endTime + ",endTimeMode=" + this.endTimeMode + ']';
  369.    }
  370.  
  371.    private synchronized void invalidateCache() {
  372.       this.cacheYear = (long)(this.startYear - 1);
  373.       this.cacheStart = this.cacheEnd = 0L;
  374.    }
  375.  
  376.    private void decodeRules() {
  377.       this.decodeStartRule();
  378.       this.decodeEndRule();
  379.    }
  380.  
  381.    private void decodeStartRule() {
  382.       this.useDaylight = this.startDay != 0 && this.endDay != 0;
  383.       if (this.startDay != 0) {
  384.          if (this.startMonth < 0 || this.startMonth > 11) {
  385.             throw new IllegalArgumentException("Illegal start month " + this.startMonth);
  386.          }
  387.  
  388.          if (this.startTime < 0 || this.startTime >= 86400000) {
  389.             throw new IllegalArgumentException("Illegal start time " + this.startTime);
  390.          }
  391.  
  392.          if (this.startDayOfWeek == 0) {
  393.             this.startMode = 1;
  394.          } else {
  395.             if (this.startDayOfWeek > 0) {
  396.                this.startMode = 2;
  397.             } else {
  398.                this.startDayOfWeek = -this.startDayOfWeek;
  399.                if (this.startDay > 0) {
  400.                   this.startMode = 3;
  401.                } else {
  402.                   this.startDay = -this.startDay;
  403.                   this.startMode = 4;
  404.                }
  405.             }
  406.  
  407.             if (this.startDayOfWeek > 7) {
  408.                throw new IllegalArgumentException("Illegal start day of week " + this.startDayOfWeek);
  409.             }
  410.          }
  411.  
  412.          if (this.startMode == 2) {
  413.             if (this.startDay < -5 || this.startDay > 5) {
  414.                throw new IllegalArgumentException("Illegal start day of week in month " + this.startDay);
  415.             }
  416.          } else if (this.startDay < 1 || this.startDay > staticMonthLength[this.startMonth]) {
  417.             throw new IllegalArgumentException("Illegal start day " + this.startDay);
  418.          }
  419.       }
  420.  
  421.    }
  422.  
  423.    private void decodeEndRule() {
  424.       this.useDaylight = this.startDay != 0 && this.endDay != 0;
  425.       if (this.endDay != 0) {
  426.          if (this.endMonth < 0 || this.endMonth > 11) {
  427.             throw new IllegalArgumentException("Illegal end month " + this.endMonth);
  428.          }
  429.  
  430.          if (this.endTime < 0 || this.endTime >= 86400000) {
  431.             throw new IllegalArgumentException("Illegal end time " + this.endTime);
  432.          }
  433.  
  434.          if (this.endDayOfWeek == 0) {
  435.             this.endMode = 1;
  436.          } else {
  437.             if (this.endDayOfWeek > 0) {
  438.                this.endMode = 2;
  439.             } else {
  440.                this.endDayOfWeek = -this.endDayOfWeek;
  441.                if (this.endDay > 0) {
  442.                   this.endMode = 3;
  443.                } else {
  444.                   this.endDay = -this.endDay;
  445.                   this.endMode = 4;
  446.                }
  447.             }
  448.  
  449.             if (this.endDayOfWeek > 7) {
  450.                throw new IllegalArgumentException("Illegal end day of week " + this.endDayOfWeek);
  451.             }
  452.          }
  453.  
  454.          if (this.endMode == 2) {
  455.             if (this.endDay < -5 || this.endDay > 5) {
  456.                throw new IllegalArgumentException("Illegal end day of week in month " + this.endDay);
  457.             }
  458.          } else if (this.endDay < 1 || this.endDay > staticMonthLength[this.endMonth]) {
  459.             throw new IllegalArgumentException("Illegal end day " + this.endDay);
  460.          }
  461.       }
  462.  
  463.    }
  464.  
  465.    private void makeRulesCompatible() {
  466.       switch (this.startMode) {
  467.          case 1:
  468.             this.startDay = 1 + this.startDay / 7;
  469.             this.startDayOfWeek = 1;
  470.          case 2:
  471.          default:
  472.             break;
  473.          case 3:
  474.             if (this.startDay != 1) {
  475.                this.startDay = 1 + this.startDay / 7;
  476.             }
  477.             break;
  478.          case 4:
  479.             if (this.startDay >= 30) {
  480.                this.startDay = -1;
  481.             } else {
  482.                this.startDay = 1 + this.startDay / 7;
  483.             }
  484.       }
  485.  
  486.       switch (this.endMode) {
  487.          case 1:
  488.             this.endDay = 1 + this.endDay / 7;
  489.             this.endDayOfWeek = 1;
  490.          case 2:
  491.          default:
  492.             break;
  493.          case 3:
  494.             if (this.endDay != 1) {
  495.                this.endDay = 1 + this.endDay / 7;
  496.             }
  497.             break;
  498.          case 4:
  499.             if (this.endDay >= 30) {
  500.                this.endDay = -1;
  501.             } else {
  502.                this.endDay = 1 + this.endDay / 7;
  503.             }
  504.       }
  505.  
  506.       switch (this.startTimeMode) {
  507.          case 2:
  508.             this.startTime += this.rawOffset;
  509.       }
  510.  
  511.       while(this.startTime < 0) {
  512.          this.startTime += 86400000;
  513.          this.startDayOfWeek = 1 + (this.startDayOfWeek + 5) % 7;
  514.       }
  515.  
  516.       while(this.startTime >= 86400000) {
  517.          this.startTime -= 86400000;
  518.          this.startDayOfWeek = 1 + this.startDayOfWeek % 7;
  519.       }
  520.  
  521.       switch (this.endTimeMode) {
  522.          case 1:
  523.             this.endTime += this.dstSavings;
  524.             break;
  525.          case 2:
  526.             this.endTime += this.rawOffset + this.dstSavings;
  527.       }
  528.  
  529.       while(this.endTime < 0) {
  530.          this.endTime += 86400000;
  531.          this.endDayOfWeek = 1 + (this.endDayOfWeek + 5) % 7;
  532.       }
  533.  
  534.       while(this.endTime >= 86400000) {
  535.          this.endTime -= 86400000;
  536.          this.endDayOfWeek = 1 + this.endDayOfWeek % 7;
  537.       }
  538.  
  539.    }
  540.  
  541.    private byte[] packRules() {
  542.       byte[] var1 = new byte[]{(byte)this.startDay, (byte)this.startDayOfWeek, (byte)this.endDay, (byte)this.endDayOfWeek, (byte)this.startTimeMode, (byte)this.endTimeMode};
  543.       return var1;
  544.    }
  545.  
  546.    private void unpackRules(byte[] var1) {
  547.       this.startDay = var1[0];
  548.       this.startDayOfWeek = var1[1];
  549.       this.endDay = var1[2];
  550.       this.endDayOfWeek = var1[3];
  551.       if (var1.length >= 6) {
  552.          this.startTimeMode = var1[4];
  553.          this.endTimeMode = var1[5];
  554.       }
  555.  
  556.    }
  557.  
  558.    private int[] packTimes() {
  559.       int[] var1 = new int[]{this.startTime, this.endTime};
  560.       return var1;
  561.    }
  562.  
  563.    private void unpackTimes(int[] var1) {
  564.       this.startTime = var1[0];
  565.       this.endTime = var1[1];
  566.    }
  567.  
  568.    private void writeObject(ObjectOutputStream var1) throws IOException {
  569.       byte[] var2 = this.packRules();
  570.       int[] var3 = this.packTimes();
  571.       this.makeRulesCompatible();
  572.       var1.defaultWriteObject();
  573.       var1.writeInt(var2.length);
  574.       var1.write(var2);
  575.       var1.writeObject(var3);
  576.       this.unpackRules(var2);
  577.       this.unpackTimes(var3);
  578.    }
  579.  
  580.    private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
  581.       var1.defaultReadObject();
  582.       if (this.serialVersionOnStream < 1) {
  583.          if (this.startDayOfWeek == 0) {
  584.             this.startDayOfWeek = 1;
  585.          }
  586.  
  587.          if (this.endDayOfWeek == 0) {
  588.             this.endDayOfWeek = 1;
  589.          }
  590.  
  591.          this.startMode = this.endMode = 2;
  592.          this.dstSavings = 3600000;
  593.       } else {
  594.          int var2 = var1.readInt();
  595.          byte[] var3 = new byte[var2];
  596.          var1.readFully(var3);
  597.          this.unpackRules(var3);
  598.       }
  599.  
  600.       if (this.serialVersionOnStream >= 2) {
  601.          int[] var4 = (int[])var1.readObject();
  602.          this.unpackTimes(var4);
  603.       }
  604.  
  605.       this.serialVersionOnStream = 2;
  606.    }
  607. }
  608.