KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > icu > util > STZInfo


1 /*
2  * Copyright (C) 2005, International Business Machines
3  * Corporation and others. All Rights Reserved.
4  */

5
6 package com.ibm.icu.util;
7
8 import java.io.Serializable JavaDoc;
9
10 /**
11  * @internal
12  */

13 final class STZInfo implements Serializable JavaDoc {
14     private static final long serialVersionUID = -7849612037842370168L;
15
16     void setStart(int sm, int sdwm, int sdw, int st, int sdm, boolean sa) {
17         this.sm = sm;
18         this.sdwm = sdwm;
19         this.sdw = sdw;
20         this.st = st;
21         this.sdm = sdm;
22         this.sa = sa;
23     }
24
25     void setEnd(int em, int edwm, int edw, int et, int edm, boolean ea) {
26         this.em = em;
27         this.edwm = edwm;
28         this.edw = edw;
29         this.et = et;
30         this.edm = edm;
31         this.ea = ea;
32     }
33
34     void applyTo(java.util.SimpleTimeZone JavaDoc stz) {
35         if (sy != -1) {
36             stz.setStartYear(sy);
37         }
38         if (sm != -1) {
39             if (sdm == -1) {
40                 stz.setStartRule(sm, sdwm, sdw, st);
41             } else if (sdw == -1) {
42                 stz.setStartRule(sm, sdm, st);
43             } else {
44                 stz.setStartRule(sm, sdm, sdw, st, sa);
45             }
46         }
47         if (em != -1) {
48             if (edm == -1) {
49                 stz.setEndRule(em, edwm, edw, et);
50             } else if (edw == -1) {
51                 stz.setEndRule(em, edm, et);
52             } else {
53                 stz.setEndRule(em, edm, edw, et, ea);
54             }
55         }
56     }
57     
58     void applyTo(com.ibm.icu.util.SimpleTimeZone stz) {
59         if (sy != -1) {
60             stz.setStartYear(sy);
61         }
62         if (sm != -1) {
63             if (sdm == -1) {
64                 stz.setStartRule(sm, sdwm, sdw, st);
65             } else if (sdw == -1) {
66                 stz.setStartRule(sm, sdm, st);
67             } else {
68                 stz.setStartRule(sm, sdm, sdw, st, sa);
69             }
70         }
71         if (em != -1) {
72             if (edm == -1) {
73                 stz.setEndRule(em, edwm, edw, et);
74             } else if (edw == -1) {
75                 stz.setEndRule(em, edm, et);
76             } else {
77                 stz.setEndRule(em, edm, edw, et, ea);
78             }
79         }
80     }
81     
82     int sy = -1;
83     int sm = -1, sdwm, sdw, st, sdm;
84     boolean sa;
85     int em = -1, edwm, edw, et, edm;
86     boolean ea;
87 }
88
89
Popular Tags