KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > charcode > CP1250CharacterSet


1 package net.sf.saxon.charcode;
2
3 /**
4 * This class defines properties of the cp1250 Central Europe character set,
5  * as defined at <a ref="http://www.microsoft.com/globaldev/reference/sbcs/1250.htm">http://www.microsoft.com/globaldev/reference/sbcs/1250.htm</a>.
6 */

7
8 public class CP1250CharacterSet implements CharacterSet{
9
10     public static CP1250CharacterSet theInstance = null;
11
12     private CP1250CharacterSet() {}
13
14     public static CP1250CharacterSet getInstance() {
15         if (theInstance == null) {
16             init();
17             theInstance = new CP1250CharacterSet();
18         }
19         return theInstance;
20     }
21
22     private static boolean[] c = null;
23
24     private static void init() {
25
26         c = new boolean[740];
27
28         for (int i=0; i<127; i++) {
29             c[i] = true;
30         }
31         for (int i=128; i<740; i++) {
32             c[i] = false;
33         }
34
35         c[160] = true;
36         c[164] = true;
37         c[166] = true;
38         c[167] = true;
39         c[168] = true;
40         c[169] = true;
41         c[171] = true;
42         c[172] = true;
43         c[173] = true;
44         c[174] = true;
45         c[176] = true;
46         c[177] = true;
47         c[180] = true;
48         c[181] = true;
49         c[182] = true;
50         c[183] = true;
51         c[184] = true;
52         c[187] = true;
53         c[193] = true;
54         c[194] = true;
55         c[196] = true;
56         c[199] = true;
57         c[201] = true;
58         c[203] = true;
59         c[205] = true;
60         c[206] = true;
61         c[211] = true;
62         c[212] = true;
63         c[214] = true;
64         c[215] = true;
65         c[218] = true;
66         c[220] = true;
67         c[221] = true;
68         c[223] = true;
69         c[225] = true;
70         c[226] = true;
71         c[228] = true;
72         c[231] = true;
73         c[233] = true;
74         c[235] = true;
75         c[237] = true;
76         c[238] = true;
77         c[243] = true;
78         c[244] = true;
79         c[246] = true;
80         c[247] = true;
81         c[250] = true;
82         c[252] = true;
83         c[253] = true;
84         c[258] = true;
85         c[259] = true;
86         c[260] = true;
87         c[261] = true;
88         c[262] = true;
89         c[263] = true;
90         c[268] = true;
91         c[269] = true;
92         c[270] = true;
93         c[271] = true;
94         c[272] = true;
95         c[273] = true;
96         c[280] = true;
97         c[281] = true;
98         c[282] = true;
99         c[283] = true;
100         c[313] = true;
101         c[314] = true;
102         c[317] = true;
103         c[318] = true;
104         c[321] = true;
105         c[322] = true;
106         c[323] = true;
107         c[324] = true;
108         c[327] = true;
109         c[328] = true;
110         c[336] = true;
111         c[337] = true;
112         c[340] = true;
113         c[341] = true;
114         c[344] = true;
115         c[345] = true;
116         c[346] = true;
117         c[347] = true;
118         c[350] = true;
119         c[351] = true;
120         c[352] = true;
121         c[353] = true;
122         c[354] = true;
123         c[355] = true;
124         c[356] = true;
125         c[357] = true;
126         c[366] = true;
127         c[367] = true;
128         c[368] = true;
129         c[369] = true;
130         c[377] = true;
131         c[378] = true;
132         c[379] = true;
133         c[380] = true;
134         c[381] = true;
135         c[382] = true;
136         c[711] = true;
137         c[728] = true;
138         c[729] = true;
139         c[731] = true;
140         c[733] = true;
141         //c[8211] = true;
142
//c[8212] = true;
143
//c[8216] = true;
144
//c[8217] = true;
145
//c[8218] = true;
146
//c[8220] = true;
147
//c[8221] = true;
148
//c[8222] = true;
149
//c[8224] = true;
150
//c[8225] = true;
151
//c[8226] = true;
152
//c[8230] = true;
153
//c[8240] = true;
154
//c[8249] = true;
155
//c[8250] = true;
156
//c[8364] = true;
157
//c[8482] = true;
158
}
159
160     public final boolean inCharset(int ch) {
161         return (ch < 740 && c[ch]) ||
162                 ch==8211 ||
163                 ch==8212 ||
164                 ch==8216 ||
165                 ch==8217 ||
166                 ch==8218 ||
167                 ch==8220 ||
168                 ch==8221 ||
169                 ch==8222 ||
170                 ch==8224 ||
171                 ch==8225 ||
172                 ch==8226 ||
173                 ch==8230 ||
174                 ch==8240 ||
175                 ch==8249 ||
176                 ch==8250 ||
177                 ch==8364 ||
178                 ch==8482;
179     }
180
181 }
182 //
183
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
184
// you may not use this file except in compliance with the License. You may obtain a copy of the
185
// License at http://www.mozilla.org/MPL/
186
//
187
// Software distributed under the License is distributed on an "AS IS" basis,
188
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
189
// See the License for the specific language governing rights and limitations under the License.
190
//
191
// The Original Code is: all this file.
192
//
193
// The Initial Developer of the Original Code is Michael H. Kay using data supplied by Jirka Kosek [jirka@kosek.cz] and Unicode.org
194
//
195
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
196
//
197
// Contributor(s): none.
198
//
199
Popular Tags