001: package net.sf.saxon.charcode;
002:
003: /**
004: * This class defines properties of the cp1250 Central Europe character set,
005: * as defined at <a ref="http://www.microsoft.com/globaldev/reference/sbcs/1250.htm">http://www.microsoft.com/globaldev/reference/sbcs/1250.htm</a>.
006: */
007:
008: public class CP1250CharacterSet implements CharacterSet {
009:
010: public static CP1250CharacterSet theInstance = null;
011:
012: private CP1250CharacterSet() {
013: }
014:
015: public static CP1250CharacterSet getInstance() {
016: if (theInstance == null) {
017: init();
018: theInstance = new CP1250CharacterSet();
019: }
020: return theInstance;
021: }
022:
023: private static boolean[] c = null;
024:
025: private static void init() {
026:
027: c = new boolean[740];
028:
029: for (int i = 0; i < 127; i++) {
030: c[i] = true;
031: }
032: for (int i = 128; i < 740; i++) {
033: c[i] = false;
034: }
035:
036: c[160] = true;
037: c[164] = true;
038: c[166] = true;
039: c[167] = true;
040: c[168] = true;
041: c[169] = true;
042: c[171] = true;
043: c[172] = true;
044: c[173] = true;
045: c[174] = true;
046: c[176] = true;
047: c[177] = true;
048: c[180] = true;
049: c[181] = true;
050: c[182] = true;
051: c[183] = true;
052: c[184] = true;
053: c[187] = true;
054: c[193] = true;
055: c[194] = true;
056: c[196] = true;
057: c[199] = true;
058: c[201] = true;
059: c[203] = true;
060: c[205] = true;
061: c[206] = true;
062: c[211] = true;
063: c[212] = true;
064: c[214] = true;
065: c[215] = true;
066: c[218] = true;
067: c[220] = true;
068: c[221] = true;
069: c[223] = true;
070: c[225] = true;
071: c[226] = true;
072: c[228] = true;
073: c[231] = true;
074: c[233] = true;
075: c[235] = true;
076: c[237] = true;
077: c[238] = true;
078: c[243] = true;
079: c[244] = true;
080: c[246] = true;
081: c[247] = true;
082: c[250] = true;
083: c[252] = true;
084: c[253] = true;
085: c[258] = true;
086: c[259] = true;
087: c[260] = true;
088: c[261] = true;
089: c[262] = true;
090: c[263] = true;
091: c[268] = true;
092: c[269] = true;
093: c[270] = true;
094: c[271] = true;
095: c[272] = true;
096: c[273] = true;
097: c[280] = true;
098: c[281] = true;
099: c[282] = true;
100: c[283] = true;
101: c[313] = true;
102: c[314] = true;
103: c[317] = true;
104: c[318] = true;
105: c[321] = true;
106: c[322] = true;
107: c[323] = true;
108: c[324] = true;
109: c[327] = true;
110: c[328] = true;
111: c[336] = true;
112: c[337] = true;
113: c[340] = true;
114: c[341] = true;
115: c[344] = true;
116: c[345] = true;
117: c[346] = true;
118: c[347] = true;
119: c[350] = true;
120: c[351] = true;
121: c[352] = true;
122: c[353] = true;
123: c[354] = true;
124: c[355] = true;
125: c[356] = true;
126: c[357] = true;
127: c[366] = true;
128: c[367] = true;
129: c[368] = true;
130: c[369] = true;
131: c[377] = true;
132: c[378] = true;
133: c[379] = true;
134: c[380] = true;
135: c[381] = true;
136: c[382] = true;
137: c[711] = true;
138: c[728] = true;
139: c[729] = true;
140: c[731] = true;
141: c[733] = true;
142: //c[8211] = true;
143: //c[8212] = true;
144: //c[8216] = true;
145: //c[8217] = true;
146: //c[8218] = true;
147: //c[8220] = true;
148: //c[8221] = true;
149: //c[8222] = true;
150: //c[8224] = true;
151: //c[8225] = true;
152: //c[8226] = true;
153: //c[8230] = true;
154: //c[8240] = true;
155: //c[8249] = true;
156: //c[8250] = true;
157: //c[8364] = true;
158: //c[8482] = true;
159: }
160:
161: public final boolean inCharset(int ch) {
162: return (ch < 740 && c[ch]) || ch == 8211 || ch == 8212
163: || ch == 8216 || ch == 8217 || ch == 8218 || ch == 8220
164: || ch == 8221 || ch == 8222 || ch == 8224 || ch == 8225
165: || ch == 8226 || ch == 8230 || ch == 8240 || ch == 8249
166: || ch == 8250 || ch == 8364 || ch == 8482;
167: }
168:
169: }
170: //
171: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
172: // you may not use this file except in compliance with the License. You may obtain a copy of the
173: // License at http://www.mozilla.org/MPL/
174: //
175: // Software distributed under the License is distributed on an "AS IS" basis,
176: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
177: // See the License for the specific language governing rights and limitations under the License.
178: //
179: // The Original Code is: all this file.
180: //
181: // The Initial Developer of the Original Code is Michael H. Kay using data supplied by Jirka Kosek [jirka@kosek.cz] and Unicode.org
182: //
183: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
184: //
185: // Contributor(s): none.
186: //
|