author | naoto |
Thu, 05 Sep 2019 17:38:54 -0700 | |
changeset 58028 | 7ac4273bb49b |
parent 55013 | 8dae495a59e7 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
55013 | 2 |
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.lang; |
|
27 |
||
52633 | 28 |
/** |
2 | 29 |
* The CharacterData00 class encapsulates the large tables once found in |
30 |
* java.lang.Character |
|
31 |
*/ |
|
32 |
||
33 |
class CharacterData00 extends CharacterData { |
|
34 |
/* The character properties are currently encoded into 32 bits in the following manner: |
|
35 |
1 bit mirrored property |
|
36 |
4 bits directionality property |
|
37 |
9 bits signed offset used for converting case |
|
38 |
1 bit if 1, adding the signed offset converts the character to lowercase |
|
39 |
1 bit if 1, subtracting the signed offset converts the character to uppercase |
|
40 |
1 bit if 1, this character has a titlecase equivalent (possibly itself) |
|
41 |
3 bits 0 may not be part of an identifier |
|
42 |
1 ignorable control; may continue a Unicode identifier or Java identifier |
|
43 |
2 may continue a Java identifier but not a Unicode identifier (unused) |
|
44 |
3 may continue a Unicode identifier or Java identifier |
|
45 |
4 is a Java whitespace character |
|
46 |
5 may start or continue a Java identifier; |
|
47 |
may continue but not start a Unicode identifier (underscores) |
|
48 |
6 may start or continue a Java identifier but not a Unicode identifier ($) |
|
49 |
7 may start or continue a Unicode identifier or Java identifier |
|
50 |
Thus: |
|
51 |
5, 6, 7 may start a Java identifier |
|
52 |
1, 2, 3, 5, 6, 7 may continue a Java identifier |
|
53 |
7 may start a Unicode identifier |
|
54 |
1, 3, 5, 7 may continue a Unicode identifier |
|
55 |
1 is ignorable within an identifier |
|
56 |
4 is Java whitespace |
|
57 |
2 bits 0 this character has no numeric property |
|
58 |
1 adding the digit offset to the character code and then |
|
59 |
masking with 0x1F will produce the desired numeric value |
|
60 |
2 this character has a "strange" numeric value |
|
61 |
3 a Java supradecimal digit: adding the digit offset to the |
|
62 |
character code, then masking with 0x1F, then adding 10 |
|
63 |
will produce the desired numeric value |
|
64 |
5 bits digit offset |
|
65 |
5 bits character type |
|
66 |
||
67 |
The encoding of character properties is subject to change at any time. |
|
68 |
*/ |
|
69 |
||
70 |
int getProperties(int ch) { |
|
71 |
char offset = (char)ch; |
|
72 |
int props = $$Lookup(offset); |
|
73 |
return props; |
|
74 |
} |
|
75 |
||
9535
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
76 |
int getPropertiesEx(int ch) { |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
77 |
char offset = (char)ch; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
78 |
int props = $$LookupEx(offset); |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
79 |
return props; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
80 |
} |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
81 |
|
2 | 82 |
int getType(int ch) { |
83 |
int props = getProperties(ch); |
|
84 |
return (props & $$maskType); |
|
85 |
} |
|
86 |
||
9535
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
87 |
boolean isOtherLowercase(int ch) { |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
88 |
int props = getPropertiesEx(ch); |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
89 |
return (props & $$maskOtherLowercase) != 0; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
90 |
} |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
91 |
|
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
92 |
boolean isOtherUppercase(int ch) { |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
93 |
int props = getPropertiesEx(ch); |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
94 |
return (props & $$maskOtherUppercase) != 0; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
95 |
} |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
96 |
|
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
97 |
boolean isOtherAlphabetic(int ch) { |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
98 |
int props = getPropertiesEx(ch); |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
99 |
return (props & $$maskOtherAlphabetic) != 0; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
100 |
} |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
101 |
|
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
102 |
boolean isIdeographic(int ch) { |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
103 |
int props = getPropertiesEx(ch); |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
104 |
return (props & $$maskIdeographic) != 0; |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
105 |
} |
d930011fd275
7037261: j.l.Character.isLowerCase/isUpperCase need to match the Unicode Standard
sherman
parents:
7247
diff
changeset
|
106 |
|
2 | 107 |
boolean isJavaIdentifierStart(int ch) { |
108 |
int props = getProperties(ch); |
|
109 |
return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); |
|
110 |
} |
|
111 |
||
112 |
boolean isJavaIdentifierPart(int ch) { |
|
113 |
int props = getProperties(ch); |
|
114 |
return ((props & $$nonzeroJavaPart) != 0); |
|
115 |
} |
|
116 |
||
117 |
boolean isUnicodeIdentifierStart(int ch) { |
|
58028
7ac4273bb49b
8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard
naoto
parents:
55013
diff
changeset
|
118 |
return (getPropertiesEx(ch) & $$maskIDStart) != 0 || |
7ac4273bb49b
8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard
naoto
parents:
55013
diff
changeset
|
119 |
ch == 0x2E2F; |
2 | 120 |
} |
121 |
||
122 |
boolean isUnicodeIdentifierPart(int ch) { |
|
58028
7ac4273bb49b
8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard
naoto
parents:
55013
diff
changeset
|
123 |
return (getPropertiesEx(ch) & $$maskIDContinue) != 0 || |
7ac4273bb49b
8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard
naoto
parents:
55013
diff
changeset
|
124 |
isIdentifierIgnorable(ch) || |
7ac4273bb49b
8229831: Upgrade Character.isUnicodeIdentifierStart/Part() methods to the latest standard
naoto
parents:
55013
diff
changeset
|
125 |
ch == 0x2E2F; |
2 | 126 |
} |
127 |
||
128 |
boolean isIdentifierIgnorable(int ch) { |
|
129 |
int props = getProperties(ch); |
|
130 |
return ((props & $$maskIdentifierInfo) == $$valueIgnorable); |
|
131 |
} |
|
132 |
||
133 |
int toLowerCase(int ch) { |
|
134 |
int mapChar = ch; |
|
135 |
int val = getProperties(ch); |
|
136 |
||
137 |
if ((val & $$maskLowerCase) != 0) { |
|
138 |
if ((val & $$maskCaseOffset) == $$maskCaseOffset) { |
|
139 |
switch(ch) { |
|
33242 | 140 |
case 0x0130: mapChar = 0x0069; break; |
141 |
case 0x023A: mapChar = 0x2C65; break; |
|
142 |
case 0x023E: mapChar = 0x2C66; break; |
|
50045 | 143 |
case 0x0412: mapChar = 0x1C80; break; |
144 |
case 0x0414: mapChar = 0x1C81; break; |
|
145 |
case 0x041E: mapChar = 0x1C82; break; |
|
146 |
case 0x0421: mapChar = 0x1C83; break; |
|
147 |
case 0x042A: mapChar = 0x1C86; break; |
|
148 |
case 0x0462: mapChar = 0x1C87; break; |
|
33242 | 149 |
case 0x10A0: mapChar = 0x2D00; break; |
150 |
case 0x10A1: mapChar = 0x2D01; break; |
|
151 |
case 0x10A2: mapChar = 0x2D02; break; |
|
152 |
case 0x10A3: mapChar = 0x2D03; break; |
|
153 |
case 0x10A4: mapChar = 0x2D04; break; |
|
154 |
case 0x10A5: mapChar = 0x2D05; break; |
|
155 |
case 0x10A6: mapChar = 0x2D06; break; |
|
156 |
case 0x10A7: mapChar = 0x2D07; break; |
|
157 |
case 0x10A8: mapChar = 0x2D08; break; |
|
158 |
case 0x10A9: mapChar = 0x2D09; break; |
|
159 |
case 0x10AA: mapChar = 0x2D0A; break; |
|
160 |
case 0x10AB: mapChar = 0x2D0B; break; |
|
161 |
case 0x10AC: mapChar = 0x2D0C; break; |
|
162 |
case 0x10AD: mapChar = 0x2D0D; break; |
|
163 |
case 0x10AE: mapChar = 0x2D0E; break; |
|
164 |
case 0x10AF: mapChar = 0x2D0F; break; |
|
165 |
case 0x10B0: mapChar = 0x2D10; break; |
|
166 |
case 0x10B1: mapChar = 0x2D11; break; |
|
167 |
case 0x10B2: mapChar = 0x2D12; break; |
|
168 |
case 0x10B3: mapChar = 0x2D13; break; |
|
169 |
case 0x10B4: mapChar = 0x2D14; break; |
|
170 |
case 0x10B5: mapChar = 0x2D15; break; |
|
171 |
case 0x10B6: mapChar = 0x2D16; break; |
|
172 |
case 0x10B7: mapChar = 0x2D17; break; |
|
173 |
case 0x10B8: mapChar = 0x2D18; break; |
|
174 |
case 0x10B9: mapChar = 0x2D19; break; |
|
175 |
case 0x10BA: mapChar = 0x2D1A; break; |
|
176 |
case 0x10BB: mapChar = 0x2D1B; break; |
|
177 |
case 0x10BC: mapChar = 0x2D1C; break; |
|
178 |
case 0x10BD: mapChar = 0x2D1D; break; |
|
179 |
case 0x10BE: mapChar = 0x2D1E; break; |
|
180 |
case 0x10BF: mapChar = 0x2D1F; break; |
|
181 |
case 0x10C0: mapChar = 0x2D20; break; |
|
182 |
case 0x10C1: mapChar = 0x2D21; break; |
|
183 |
case 0x10C2: mapChar = 0x2D22; break; |
|
184 |
case 0x10C3: mapChar = 0x2D23; break; |
|
185 |
case 0x10C4: mapChar = 0x2D24; break; |
|
186 |
case 0x10C5: mapChar = 0x2D25; break; |
|
187 |
case 0x10C7: mapChar = 0x2D27; break; |
|
188 |
case 0x10CD: mapChar = 0x2D2D; break; |
|
189 |
case 0x13A0: mapChar = 0xAB70; break; |
|
190 |
case 0x13A1: mapChar = 0xAB71; break; |
|
191 |
case 0x13A2: mapChar = 0xAB72; break; |
|
192 |
case 0x13A3: mapChar = 0xAB73; break; |
|
193 |
case 0x13A4: mapChar = 0xAB74; break; |
|
194 |
case 0x13A5: mapChar = 0xAB75; break; |
|
195 |
case 0x13A6: mapChar = 0xAB76; break; |
|
196 |
case 0x13A7: mapChar = 0xAB77; break; |
|
197 |
case 0x13A8: mapChar = 0xAB78; break; |
|
198 |
case 0x13A9: mapChar = 0xAB79; break; |
|
199 |
case 0x13AA: mapChar = 0xAB7A; break; |
|
200 |
case 0x13AB: mapChar = 0xAB7B; break; |
|
201 |
case 0x13AC: mapChar = 0xAB7C; break; |
|
202 |
case 0x13AD: mapChar = 0xAB7D; break; |
|
203 |
case 0x13AE: mapChar = 0xAB7E; break; |
|
204 |
case 0x13AF: mapChar = 0xAB7F; break; |
|
205 |
case 0x13B0: mapChar = 0xAB80; break; |
|
206 |
case 0x13B1: mapChar = 0xAB81; break; |
|
207 |
case 0x13B2: mapChar = 0xAB82; break; |
|
208 |
case 0x13B3: mapChar = 0xAB83; break; |
|
209 |
case 0x13B4: mapChar = 0xAB84; break; |
|
210 |
case 0x13B5: mapChar = 0xAB85; break; |
|
211 |
case 0x13B6: mapChar = 0xAB86; break; |
|
212 |
case 0x13B7: mapChar = 0xAB87; break; |
|
213 |
case 0x13B8: mapChar = 0xAB88; break; |
|
214 |
case 0x13B9: mapChar = 0xAB89; break; |
|
215 |
case 0x13BA: mapChar = 0xAB8A; break; |
|
216 |
case 0x13BB: mapChar = 0xAB8B; break; |
|
217 |
case 0x13BC: mapChar = 0xAB8C; break; |
|
218 |
case 0x13BD: mapChar = 0xAB8D; break; |
|
219 |
case 0x13BE: mapChar = 0xAB8E; break; |
|
220 |
case 0x13BF: mapChar = 0xAB8F; break; |
|
221 |
case 0x13C0: mapChar = 0xAB90; break; |
|
222 |
case 0x13C1: mapChar = 0xAB91; break; |
|
223 |
case 0x13C2: mapChar = 0xAB92; break; |
|
224 |
case 0x13C3: mapChar = 0xAB93; break; |
|
225 |
case 0x13C4: mapChar = 0xAB94; break; |
|
226 |
case 0x13C5: mapChar = 0xAB95; break; |
|
227 |
case 0x13C6: mapChar = 0xAB96; break; |
|
228 |
case 0x13C7: mapChar = 0xAB97; break; |
|
229 |
case 0x13C8: mapChar = 0xAB98; break; |
|
230 |
case 0x13C9: mapChar = 0xAB99; break; |
|
231 |
case 0x13CA: mapChar = 0xAB9A; break; |
|
232 |
case 0x13CB: mapChar = 0xAB9B; break; |
|
233 |
case 0x13CC: mapChar = 0xAB9C; break; |
|
234 |
case 0x13CD: mapChar = 0xAB9D; break; |
|
235 |
case 0x13CE: mapChar = 0xAB9E; break; |
|
236 |
case 0x13CF: mapChar = 0xAB9F; break; |
|
237 |
case 0x13D0: mapChar = 0xABA0; break; |
|
238 |
case 0x13D1: mapChar = 0xABA1; break; |
|
239 |
case 0x13D2: mapChar = 0xABA2; break; |
|
240 |
case 0x13D3: mapChar = 0xABA3; break; |
|
241 |
case 0x13D4: mapChar = 0xABA4; break; |
|
242 |
case 0x13D5: mapChar = 0xABA5; break; |
|
243 |
case 0x13D6: mapChar = 0xABA6; break; |
|
244 |
case 0x13D7: mapChar = 0xABA7; break; |
|
245 |
case 0x13D8: mapChar = 0xABA8; break; |
|
246 |
case 0x13D9: mapChar = 0xABA9; break; |
|
247 |
case 0x13DA: mapChar = 0xABAA; break; |
|
248 |
case 0x13DB: mapChar = 0xABAB; break; |
|
249 |
case 0x13DC: mapChar = 0xABAC; break; |
|
250 |
case 0x13DD: mapChar = 0xABAD; break; |
|
251 |
case 0x13DE: mapChar = 0xABAE; break; |
|
252 |
case 0x13DF: mapChar = 0xABAF; break; |
|
253 |
case 0x13E0: mapChar = 0xABB0; break; |
|
254 |
case 0x13E1: mapChar = 0xABB1; break; |
|
255 |
case 0x13E2: mapChar = 0xABB2; break; |
|
256 |
case 0x13E3: mapChar = 0xABB3; break; |
|
257 |
case 0x13E4: mapChar = 0xABB4; break; |
|
258 |
case 0x13E5: mapChar = 0xABB5; break; |
|
259 |
case 0x13E6: mapChar = 0xABB6; break; |
|
260 |
case 0x13E7: mapChar = 0xABB7; break; |
|
261 |
case 0x13E8: mapChar = 0xABB8; break; |
|
262 |
case 0x13E9: mapChar = 0xABB9; break; |
|
263 |
case 0x13EA: mapChar = 0xABBA; break; |
|
264 |
case 0x13EB: mapChar = 0xABBB; break; |
|
265 |
case 0x13EC: mapChar = 0xABBC; break; |
|
266 |
case 0x13ED: mapChar = 0xABBD; break; |
|
267 |
case 0x13EE: mapChar = 0xABBE; break; |
|
268 |
case 0x13EF: mapChar = 0xABBF; break; |
|
52633 | 269 |
case 0x1C90: mapChar = 0x10D0; break; |
270 |
case 0x1C91: mapChar = 0x10D1; break; |
|
271 |
case 0x1C92: mapChar = 0x10D2; break; |
|
272 |
case 0x1C93: mapChar = 0x10D3; break; |
|
273 |
case 0x1C94: mapChar = 0x10D4; break; |
|
274 |
case 0x1C95: mapChar = 0x10D5; break; |
|
275 |
case 0x1C96: mapChar = 0x10D6; break; |
|
276 |
case 0x1C97: mapChar = 0x10D7; break; |
|
277 |
case 0x1C98: mapChar = 0x10D8; break; |
|
278 |
case 0x1C99: mapChar = 0x10D9; break; |
|
279 |
case 0x1C9A: mapChar = 0x10DA; break; |
|
280 |
case 0x1C9B: mapChar = 0x10DB; break; |
|
281 |
case 0x1C9C: mapChar = 0x10DC; break; |
|
282 |
case 0x1C9D: mapChar = 0x10DD; break; |
|
283 |
case 0x1C9E: mapChar = 0x10DE; break; |
|
284 |
case 0x1C9F: mapChar = 0x10DF; break; |
|
285 |
case 0x1CA0: mapChar = 0x10E0; break; |
|
286 |
case 0x1CA1: mapChar = 0x10E1; break; |
|
287 |
case 0x1CA2: mapChar = 0x10E2; break; |
|
288 |
case 0x1CA3: mapChar = 0x10E3; break; |
|
289 |
case 0x1CA4: mapChar = 0x10E4; break; |
|
290 |
case 0x1CA5: mapChar = 0x10E5; break; |
|
291 |
case 0x1CA6: mapChar = 0x10E6; break; |
|
292 |
case 0x1CA7: mapChar = 0x10E7; break; |
|
293 |
case 0x1CA8: mapChar = 0x10E8; break; |
|
294 |
case 0x1CA9: mapChar = 0x10E9; break; |
|
295 |
case 0x1CAA: mapChar = 0x10EA; break; |
|
296 |
case 0x1CAB: mapChar = 0x10EB; break; |
|
297 |
case 0x1CAC: mapChar = 0x10EC; break; |
|
298 |
case 0x1CAD: mapChar = 0x10ED; break; |
|
299 |
case 0x1CAE: mapChar = 0x10EE; break; |
|
300 |
case 0x1CAF: mapChar = 0x10EF; break; |
|
301 |
case 0x1CB0: mapChar = 0x10F0; break; |
|
302 |
case 0x1CB1: mapChar = 0x10F1; break; |
|
303 |
case 0x1CB2: mapChar = 0x10F2; break; |
|
304 |
case 0x1CB3: mapChar = 0x10F3; break; |
|
305 |
case 0x1CB4: mapChar = 0x10F4; break; |
|
306 |
case 0x1CB5: mapChar = 0x10F5; break; |
|
307 |
case 0x1CB6: mapChar = 0x10F6; break; |
|
308 |
case 0x1CB7: mapChar = 0x10F7; break; |
|
309 |
case 0x1CB8: mapChar = 0x10F8; break; |
|
310 |
case 0x1CB9: mapChar = 0x10F9; break; |
|
311 |
case 0x1CBA: mapChar = 0x10FA; break; |
|
312 |
case 0x1CBB: mapChar = 0x10FB; break; |
|
313 |
case 0x1CBC: mapChar = 0x10FC; break; |
|
314 |
case 0x1CBD: mapChar = 0x10FD; break; |
|
315 |
case 0x1CBE: mapChar = 0x10FE; break; |
|
316 |
case 0x1CBF: mapChar = 0x10FF; break; |
|
33242 | 317 |
case 0x1E9E: mapChar = 0x00DF; break; |
318 |
case 0x1F88: mapChar = 0x1F80; break; |
|
319 |
case 0x1F89: mapChar = 0x1F81; break; |
|
320 |
case 0x1F8A: mapChar = 0x1F82; break; |
|
321 |
case 0x1F8B: mapChar = 0x1F83; break; |
|
322 |
case 0x1F8C: mapChar = 0x1F84; break; |
|
323 |
case 0x1F8D: mapChar = 0x1F85; break; |
|
324 |
case 0x1F8E: mapChar = 0x1F86; break; |
|
325 |
case 0x1F8F: mapChar = 0x1F87; break; |
|
326 |
case 0x1F98: mapChar = 0x1F90; break; |
|
327 |
case 0x1F99: mapChar = 0x1F91; break; |
|
328 |
case 0x1F9A: mapChar = 0x1F92; break; |
|
329 |
case 0x1F9B: mapChar = 0x1F93; break; |
|
330 |
case 0x1F9C: mapChar = 0x1F94; break; |
|
331 |
case 0x1F9D: mapChar = 0x1F95; break; |
|
332 |
case 0x1F9E: mapChar = 0x1F96; break; |
|
333 |
case 0x1F9F: mapChar = 0x1F97; break; |
|
334 |
case 0x1FA8: mapChar = 0x1FA0; break; |
|
335 |
case 0x1FA9: mapChar = 0x1FA1; break; |
|
336 |
case 0x1FAA: mapChar = 0x1FA2; break; |
|
337 |
case 0x1FAB: mapChar = 0x1FA3; break; |
|
338 |
case 0x1FAC: mapChar = 0x1FA4; break; |
|
339 |
case 0x1FAD: mapChar = 0x1FA5; break; |
|
340 |
case 0x1FAE: mapChar = 0x1FA6; break; |
|
341 |
case 0x1FAF: mapChar = 0x1FA7; break; |
|
342 |
case 0x1FBC: mapChar = 0x1FB3; break; |
|
343 |
case 0x1FCC: mapChar = 0x1FC3; break; |
|
344 |
case 0x1FFC: mapChar = 0x1FF3; break; |
|
345 |
case 0x2126: mapChar = 0x03C9; break; |
|
346 |
case 0x212A: mapChar = 0x006B; break; |
|
347 |
case 0x212B: mapChar = 0x00E5; break; |
|
348 |
case 0x2C62: mapChar = 0x026B; break; |
|
349 |
case 0x2C63: mapChar = 0x1D7D; break; |
|
350 |
case 0x2C64: mapChar = 0x027D; break; |
|
351 |
case 0x2C6D: mapChar = 0x0251; break; |
|
352 |
case 0x2C6E: mapChar = 0x0271; break; |
|
353 |
case 0x2C6F: mapChar = 0x0250; break; |
|
354 |
case 0x2C70: mapChar = 0x0252; break; |
|
355 |
case 0x2C7E: mapChar = 0x023F; break; |
|
356 |
case 0x2C7F: mapChar = 0x0240; break; |
|
50045 | 357 |
case 0xA64A: mapChar = 0x1C88; break; |
33242 | 358 |
case 0xA77D: mapChar = 0x1D79; break; |
359 |
case 0xA78D: mapChar = 0x0265; break; |
|
360 |
case 0xA7AA: mapChar = 0x0266; break; |
|
361 |
case 0xA7AB: mapChar = 0x025C; break; |
|
362 |
case 0xA7AC: mapChar = 0x0261; break; |
|
363 |
case 0xA7AD: mapChar = 0x026C; break; |
|
50045 | 364 |
case 0xA7AE: mapChar = 0x026A; break; |
33242 | 365 |
case 0xA7B0: mapChar = 0x029E; break; |
366 |
case 0xA7B1: mapChar = 0x0287; break; |
|
367 |
case 0xA7B2: mapChar = 0x029D; break; |
|
368 |
case 0xA7B3: mapChar = 0xAB53; break; |
|
55013 | 369 |
case 0xA7C5: mapChar = 0x0282; break; |
370 |
case 0xA7C6: mapChar = 0x1D8E; break; |
|
2 | 371 |
// default mapChar is already set, so no |
372 |
// need to redo it here. |
|
373 |
// default : mapChar = ch; |
|
374 |
} |
|
375 |
} |
|
376 |
else { |
|
377 |
int offset = val << $$shiftCaseOffsetSign >> ($$shiftCaseOffsetSign+$$shiftCaseOffset); |
|
378 |
mapChar = ch + offset; |
|
379 |
} |
|
380 |
} |
|
381 |
return mapChar; |
|
382 |
} |
|
383 |
||
384 |
int toUpperCase(int ch) { |
|
385 |
int mapChar = ch; |
|
386 |
int val = getProperties(ch); |
|
387 |
||
388 |
if ((val & $$maskUpperCase) != 0) { |
|
389 |
if ((val & $$maskCaseOffset) == $$maskCaseOffset) { |
|
390 |
switch(ch) { |
|
33242 | 391 |
case 0x017F: mapChar = 0x0053; break; |
392 |
case 0x023F: mapChar = 0x2C7E; break; |
|
393 |
case 0x0240: mapChar = 0x2C7F; break; |
|
394 |
case 0x0250: mapChar = 0x2C6F; break; |
|
395 |
case 0x0251: mapChar = 0x2C6D; break; |
|
396 |
case 0x0252: mapChar = 0x2C70; break; |
|
397 |
case 0x025C: mapChar = 0xA7AB; break; |
|
398 |
case 0x0261: mapChar = 0xA7AC; break; |
|
399 |
case 0x0265: mapChar = 0xA78D; break; |
|
400 |
case 0x0266: mapChar = 0xA7AA; break; |
|
50045 | 401 |
case 0x026A: mapChar = 0xA7AE; break; |
33242 | 402 |
case 0x026B: mapChar = 0x2C62; break; |
403 |
case 0x026C: mapChar = 0xA7AD; break; |
|
404 |
case 0x0271: mapChar = 0x2C6E; break; |
|
405 |
case 0x027D: mapChar = 0x2C64; break; |
|
55013 | 406 |
case 0x0282: mapChar = 0xA7C5; break; |
33242 | 407 |
case 0x0287: mapChar = 0xA7B1; break; |
408 |
case 0x029D: mapChar = 0xA7B2; break; |
|
409 |
case 0x029E: mapChar = 0xA7B0; break; |
|
52633 | 410 |
case 0x10D0: mapChar = 0x1C90; break; |
411 |
case 0x10D1: mapChar = 0x1C91; break; |
|
412 |
case 0x10D2: mapChar = 0x1C92; break; |
|
413 |
case 0x10D3: mapChar = 0x1C93; break; |
|
414 |
case 0x10D4: mapChar = 0x1C94; break; |
|
415 |
case 0x10D5: mapChar = 0x1C95; break; |
|
416 |
case 0x10D6: mapChar = 0x1C96; break; |
|
417 |
case 0x10D7: mapChar = 0x1C97; break; |
|
418 |
case 0x10D8: mapChar = 0x1C98; break; |
|
419 |
case 0x10D9: mapChar = 0x1C99; break; |
|
420 |
case 0x10DA: mapChar = 0x1C9A; break; |
|
421 |
case 0x10DB: mapChar = 0x1C9B; break; |
|
422 |
case 0x10DC: mapChar = 0x1C9C; break; |
|
423 |
case 0x10DD: mapChar = 0x1C9D; break; |
|
424 |
case 0x10DE: mapChar = 0x1C9E; break; |
|
425 |
case 0x10DF: mapChar = 0x1C9F; break; |
|
426 |
case 0x10E0: mapChar = 0x1CA0; break; |
|
427 |
case 0x10E1: mapChar = 0x1CA1; break; |
|
428 |
case 0x10E2: mapChar = 0x1CA2; break; |
|
429 |
case 0x10E3: mapChar = 0x1CA3; break; |
|
430 |
case 0x10E4: mapChar = 0x1CA4; break; |
|
431 |
case 0x10E5: mapChar = 0x1CA5; break; |
|
432 |
case 0x10E6: mapChar = 0x1CA6; break; |
|
433 |
case 0x10E7: mapChar = 0x1CA7; break; |
|
434 |
case 0x10E8: mapChar = 0x1CA8; break; |
|
435 |
case 0x10E9: mapChar = 0x1CA9; break; |
|
436 |
case 0x10EA: mapChar = 0x1CAA; break; |
|
437 |
case 0x10EB: mapChar = 0x1CAB; break; |
|
438 |
case 0x10EC: mapChar = 0x1CAC; break; |
|
439 |
case 0x10ED: mapChar = 0x1CAD; break; |
|
440 |
case 0x10EE: mapChar = 0x1CAE; break; |
|
441 |
case 0x10EF: mapChar = 0x1CAF; break; |
|
442 |
case 0x10F0: mapChar = 0x1CB0; break; |
|
443 |
case 0x10F1: mapChar = 0x1CB1; break; |
|
444 |
case 0x10F2: mapChar = 0x1CB2; break; |
|
445 |
case 0x10F3: mapChar = 0x1CB3; break; |
|
446 |
case 0x10F4: mapChar = 0x1CB4; break; |
|
447 |
case 0x10F5: mapChar = 0x1CB5; break; |
|
448 |
case 0x10F6: mapChar = 0x1CB6; break; |
|
449 |
case 0x10F7: mapChar = 0x1CB7; break; |
|
450 |
case 0x10F8: mapChar = 0x1CB8; break; |
|
451 |
case 0x10F9: mapChar = 0x1CB9; break; |
|
452 |
case 0x10FA: mapChar = 0x1CBA; break; |
|
453 |
case 0x10FD: mapChar = 0x1CBD; break; |
|
454 |
case 0x10FE: mapChar = 0x1CBE; break; |
|
455 |
case 0x10FF: mapChar = 0x1CBF; break; |
|
50045 | 456 |
case 0x1C80: mapChar = 0x0412; break; |
457 |
case 0x1C81: mapChar = 0x0414; break; |
|
458 |
case 0x1C82: mapChar = 0x041E; break; |
|
459 |
case 0x1C83: mapChar = 0x0421; break; |
|
460 |
case 0x1C84: mapChar = 0x0422; break; |
|
461 |
case 0x1C85: mapChar = 0x0422; break; |
|
462 |
case 0x1C86: mapChar = 0x042A; break; |
|
463 |
case 0x1C87: mapChar = 0x0462; break; |
|
464 |
case 0x1C88: mapChar = 0xA64A; break; |
|
33242 | 465 |
case 0x1D79: mapChar = 0xA77D; break; |
466 |
case 0x1D7D: mapChar = 0x2C63; break; |
|
55013 | 467 |
case 0x1D8E: mapChar = 0xA7C6; break; |
33242 | 468 |
case 0x1F80: mapChar = 0x1F88; break; |
469 |
case 0x1F81: mapChar = 0x1F89; break; |
|
470 |
case 0x1F82: mapChar = 0x1F8A; break; |
|
471 |
case 0x1F83: mapChar = 0x1F8B; break; |
|
472 |
case 0x1F84: mapChar = 0x1F8C; break; |
|
473 |
case 0x1F85: mapChar = 0x1F8D; break; |
|
474 |
case 0x1F86: mapChar = 0x1F8E; break; |
|
475 |
case 0x1F87: mapChar = 0x1F8F; break; |
|
476 |
case 0x1F90: mapChar = 0x1F98; break; |
|
477 |
case 0x1F91: mapChar = 0x1F99; break; |
|
478 |
case 0x1F92: mapChar = 0x1F9A; break; |
|
479 |
case 0x1F93: mapChar = 0x1F9B; break; |
|
480 |
case 0x1F94: mapChar = 0x1F9C; break; |
|
481 |
case 0x1F95: mapChar = 0x1F9D; break; |
|
482 |
case 0x1F96: mapChar = 0x1F9E; break; |
|
483 |
case 0x1F97: mapChar = 0x1F9F; break; |
|
484 |
case 0x1FA0: mapChar = 0x1FA8; break; |
|
485 |
case 0x1FA1: mapChar = 0x1FA9; break; |
|
486 |
case 0x1FA2: mapChar = 0x1FAA; break; |
|
487 |
case 0x1FA3: mapChar = 0x1FAB; break; |
|
488 |
case 0x1FA4: mapChar = 0x1FAC; break; |
|
489 |
case 0x1FA5: mapChar = 0x1FAD; break; |
|
490 |
case 0x1FA6: mapChar = 0x1FAE; break; |
|
491 |
case 0x1FA7: mapChar = 0x1FAF; break; |
|
492 |
case 0x1FB3: mapChar = 0x1FBC; break; |
|
493 |
case 0x1FBE: mapChar = 0x0399; break; |
|
494 |
case 0x1FC3: mapChar = 0x1FCC; break; |
|
495 |
case 0x1FF3: mapChar = 0x1FFC; break; |
|
496 |
case 0x2C65: mapChar = 0x023A; break; |
|
497 |
case 0x2C66: mapChar = 0x023E; break; |
|
498 |
case 0x2D00: mapChar = 0x10A0; break; |
|
499 |
case 0x2D01: mapChar = 0x10A1; break; |
|
500 |
case 0x2D02: mapChar = 0x10A2; break; |
|
501 |
case 0x2D03: mapChar = 0x10A3; break; |
|
502 |
case 0x2D04: mapChar = 0x10A4; break; |
|
503 |
case 0x2D05: mapChar = 0x10A5; break; |
|
504 |
case 0x2D06: mapChar = 0x10A6; break; |
|
505 |
case 0x2D07: mapChar = 0x10A7; break; |
|
506 |
case 0x2D08: mapChar = 0x10A8; break; |
|
507 |
case 0x2D09: mapChar = 0x10A9; break; |
|
508 |
case 0x2D0A: mapChar = 0x10AA; break; |
|
509 |
case 0x2D0B: mapChar = 0x10AB; break; |
|
510 |
case 0x2D0C: mapChar = 0x10AC; break; |
|
511 |
case 0x2D0D: mapChar = 0x10AD; break; |
|
512 |
case 0x2D0E: mapChar = 0x10AE; break; |
|
513 |
case 0x2D0F: mapChar = 0x10AF; break; |
|
514 |
case 0x2D10: mapChar = 0x10B0; break; |
|
515 |
case 0x2D11: mapChar = 0x10B1; break; |
|
516 |
case 0x2D12: mapChar = 0x10B2; break; |
|
517 |
case 0x2D13: mapChar = 0x10B3; break; |
|
518 |
case 0x2D14: mapChar = 0x10B4; break; |
|
519 |
case 0x2D15: mapChar = 0x10B5; break; |
|
520 |
case 0x2D16: mapChar = 0x10B6; break; |
|
521 |
case 0x2D17: mapChar = 0x10B7; break; |
|
522 |
case 0x2D18: mapChar = 0x10B8; break; |
|
523 |
case 0x2D19: mapChar = 0x10B9; break; |
|
524 |
case 0x2D1A: mapChar = 0x10BA; break; |
|
525 |
case 0x2D1B: mapChar = 0x10BB; break; |
|
526 |
case 0x2D1C: mapChar = 0x10BC; break; |
|
527 |
case 0x2D1D: mapChar = 0x10BD; break; |
|
528 |
case 0x2D1E: mapChar = 0x10BE; break; |
|
529 |
case 0x2D1F: mapChar = 0x10BF; break; |
|
530 |
case 0x2D20: mapChar = 0x10C0; break; |
|
531 |
case 0x2D21: mapChar = 0x10C1; break; |
|
532 |
case 0x2D22: mapChar = 0x10C2; break; |
|
533 |
case 0x2D23: mapChar = 0x10C3; break; |
|
534 |
case 0x2D24: mapChar = 0x10C4; break; |
|
535 |
case 0x2D25: mapChar = 0x10C5; break; |
|
536 |
case 0x2D27: mapChar = 0x10C7; break; |
|
537 |
case 0x2D2D: mapChar = 0x10CD; break; |
|
538 |
case 0xAB53: mapChar = 0xA7B3; break; |
|
539 |
case 0xAB70: mapChar = 0x13A0; break; |
|
540 |
case 0xAB71: mapChar = 0x13A1; break; |
|
541 |
case 0xAB72: mapChar = 0x13A2; break; |
|
542 |
case 0xAB73: mapChar = 0x13A3; break; |
|
543 |
case 0xAB74: mapChar = 0x13A4; break; |
|
544 |
case 0xAB75: mapChar = 0x13A5; break; |
|
545 |
case 0xAB76: mapChar = 0x13A6; break; |
|
546 |
case 0xAB77: mapChar = 0x13A7; break; |
|
547 |
case 0xAB78: mapChar = 0x13A8; break; |
|
548 |
case 0xAB79: mapChar = 0x13A9; break; |
|
549 |
case 0xAB7A: mapChar = 0x13AA; break; |
|
550 |
case 0xAB7B: mapChar = 0x13AB; break; |
|
551 |
case 0xAB7C: mapChar = 0x13AC; break; |
|
552 |
case 0xAB7D: mapChar = 0x13AD; break; |
|
553 |
case 0xAB7E: mapChar = 0x13AE; break; |
|
554 |
case 0xAB7F: mapChar = 0x13AF; break; |
|
555 |
case 0xAB80: mapChar = 0x13B0; break; |
|
556 |
case 0xAB81: mapChar = 0x13B1; break; |
|
557 |
case 0xAB82: mapChar = 0x13B2; break; |
|
558 |
case 0xAB83: mapChar = 0x13B3; break; |
|
559 |
case 0xAB84: mapChar = 0x13B4; break; |
|
560 |
case 0xAB85: mapChar = 0x13B5; break; |
|
561 |
case 0xAB86: mapChar = 0x13B6; break; |
|
562 |
case 0xAB87: mapChar = 0x13B7; break; |
|
563 |
case 0xAB88: mapChar = 0x13B8; break; |
|
564 |
case 0xAB89: mapChar = 0x13B9; break; |
|
565 |
case 0xAB8A: mapChar = 0x13BA; break; |
|
566 |
case 0xAB8B: mapChar = 0x13BB; break; |
|
567 |
case 0xAB8C: mapChar = 0x13BC; break; |
|
568 |
case 0xAB8D: mapChar = 0x13BD; break; |
|
569 |
case 0xAB8E: mapChar = 0x13BE; break; |
|
570 |
case 0xAB8F: mapChar = 0x13BF; break; |
|
571 |
case 0xAB90: mapChar = 0x13C0; break; |
|
572 |
case 0xAB91: mapChar = 0x13C1; break; |
|
573 |
case 0xAB92: mapChar = 0x13C2; break; |
|
574 |
case 0xAB93: mapChar = 0x13C3; break; |
|
575 |
case 0xAB94: mapChar = 0x13C4; break; |
|
576 |
case 0xAB95: mapChar = 0x13C5; break; |
|
577 |
case 0xAB96: mapChar = 0x13C6; break; |
|
578 |
case 0xAB97: mapChar = 0x13C7; break; |
|
579 |
case 0xAB98: mapChar = 0x13C8; break; |
|
580 |
case 0xAB99: mapChar = 0x13C9; break; |
|
581 |
case 0xAB9A: mapChar = 0x13CA; break; |
|
582 |
case 0xAB9B: mapChar = 0x13CB; break; |
|
583 |
case 0xAB9C: mapChar = 0x13CC; break; |
|
584 |
case 0xAB9D: mapChar = 0x13CD; break; |
|
585 |
case 0xAB9E: mapChar = 0x13CE; break; |
|
586 |
case 0xAB9F: mapChar = 0x13CF; break; |
|
587 |
case 0xABA0: mapChar = 0x13D0; break; |
|
588 |
case 0xABA1: mapChar = 0x13D1; break; |
|
589 |
case 0xABA2: mapChar = 0x13D2; break; |
|
590 |
case 0xABA3: mapChar = 0x13D3; break; |
|
591 |
case 0xABA4: mapChar = 0x13D4; break; |
|
592 |
case 0xABA5: mapChar = 0x13D5; break; |
|
593 |
case 0xABA6: mapChar = 0x13D6; break; |
|
594 |
case 0xABA7: mapChar = 0x13D7; break; |
|
595 |
case 0xABA8: mapChar = 0x13D8; break; |
|
596 |
case 0xABA9: mapChar = 0x13D9; break; |
|
597 |
case 0xABAA: mapChar = 0x13DA; break; |
|
598 |
case 0xABAB: mapChar = 0x13DB; break; |
|
599 |
case 0xABAC: mapChar = 0x13DC; break; |
|
600 |
case 0xABAD: mapChar = 0x13DD; break; |
|
601 |
case 0xABAE: mapChar = 0x13DE; break; |
|
602 |
case 0xABAF: mapChar = 0x13DF; break; |
|
603 |
case 0xABB0: mapChar = 0x13E0; break; |
|
604 |
case 0xABB1: mapChar = 0x13E1; break; |
|
605 |
case 0xABB2: mapChar = 0x13E2; break; |
|
606 |
case 0xABB3: mapChar = 0x13E3; break; |
|
607 |
case 0xABB4: mapChar = 0x13E4; break; |
|
608 |
case 0xABB5: mapChar = 0x13E5; break; |
|
609 |
case 0xABB6: mapChar = 0x13E6; break; |
|
610 |
case 0xABB7: mapChar = 0x13E7; break; |
|
611 |
case 0xABB8: mapChar = 0x13E8; break; |
|
612 |
case 0xABB9: mapChar = 0x13E9; break; |
|
613 |
case 0xABBA: mapChar = 0x13EA; break; |
|
614 |
case 0xABBB: mapChar = 0x13EB; break; |
|
615 |
case 0xABBC: mapChar = 0x13EC; break; |
|
616 |
case 0xABBD: mapChar = 0x13ED; break; |
|
617 |
case 0xABBE: mapChar = 0x13EE; break; |
|
618 |
case 0xABBF: mapChar = 0x13EF; break; |
|
2 | 619 |
// ch must have a 1:M case mapping, but we |
620 |
// can't handle it here. Return ch. |
|
621 |
// since mapChar is already set, no need |
|
622 |
// to redo it here. |
|
623 |
//default : mapChar = ch; |
|
624 |
} |
|
625 |
} |
|
626 |
else { |
|
627 |
int offset = val << $$shiftCaseOffsetSign >> ($$shiftCaseOffsetSign+$$shiftCaseOffset); |
|
628 |
mapChar = ch - offset; |
|
629 |
} |
|
630 |
} |
|
631 |
return mapChar; |
|
632 |
} |
|
633 |
||
634 |
int toTitleCase(int ch) { |
|
635 |
int mapChar = ch; |
|
636 |
int val = getProperties(ch); |
|
637 |
||
638 |
if ((val & $$maskTitleCase) != 0) { |
|
639 |
// There is a titlecase equivalent. Perform further checks: |
|
640 |
if ((val & $$maskUpperCase) == 0) { |
|
641 |
// The character does not have an uppercase equivalent, so it must |
|
642 |
// already be uppercase; so add 1 to get the titlecase form. |
|
643 |
mapChar = ch + 1; |
|
644 |
} |
|
645 |
else if ((val & $$maskLowerCase) == 0) { |
|
52633 | 646 |
// For some Georgian letters, titlecase form is |
647 |
// same as this character. |
|
648 |
if(ch >= 0x10D0 && ch <= 0x10FF) { |
|
649 |
mapChar = ch; |
|
650 |
} |
|
651 |
else { |
|
652 |
// The character does not have a lowercase equivalent, so it must |
|
653 |
// already be lowercase; so subtract 1 to get the titlecase form. |
|
654 |
mapChar = ch - 1; |
|
655 |
} |
|
2 | 656 |
} |
657 |
// else { |
|
658 |
// The character has both an uppercase equivalent and a lowercase |
|
659 |
// equivalent, so it must itself be a titlecase form; return it. |
|
660 |
// return ch; |
|
661 |
//} |
|
662 |
} |
|
663 |
else if ((val & $$maskUpperCase) != 0) { |
|
664 |
// This character has no titlecase equivalent but it does have an |
|
665 |
// uppercase equivalent, so use that (subtract the signed case offset). |
|
666 |
mapChar = toUpperCase(ch); |
|
667 |
} |
|
668 |
return mapChar; |
|
669 |
} |
|
670 |
||
671 |
int digit(int ch, int radix) { |
|
672 |
int value = -1; |
|
673 |
if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) { |
|
674 |
int val = getProperties(ch); |
|
675 |
int kind = val & $$maskType; |
|
676 |
if (kind == Character.DECIMAL_DIGIT_NUMBER) { |
|
677 |
value = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit; |
|
678 |
} |
|
679 |
else if ((val & $$maskNumericType) == $$valueJavaSupradecimal) { |
|
680 |
// Java supradecimal digit |
|
681 |
value = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10; |
|
682 |
} |
|
683 |
} |
|
684 |
return (value < radix) ? value : -1; |
|
685 |
} |
|
686 |
||
687 |
int getNumericValue(int ch) { |
|
688 |
int val = getProperties(ch); |
|
689 |
int retval = -1; |
|
690 |
||
691 |
switch (val & $$maskNumericType) { |
|
692 |
default: // cannot occur |
|
693 |
case ($$valueNotNumeric): // not numeric |
|
694 |
retval = -1; |
|
695 |
break; |
|
696 |
case ($$valueDigit): // simple numeric |
|
697 |
retval = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit; |
|
698 |
break; |
|
699 |
case ($$valueStrangeNumeric) : // "strange" numeric |
|
700 |
switch (ch) { |
|
701 |
case 0x0BF1: retval = 100; break; // TAMIL NUMBER ONE HUNDRED |
|
702 |
case 0x0BF2: retval = 1000; break; // TAMIL NUMBER ONE THOUSAND |
|
33242 | 703 |
case 0x0D71: retval = 100; break; // MALAYALAM NUMBER ONE HUNDRED |
704 |
case 0x0D72: retval = 1000; break; // MALAYALAM NUMBER ONE THOUSAND |
|
2 | 705 |
case 0x1375: retval = 40; break; // ETHIOPIC NUMBER FORTY |
706 |
case 0x1376: retval = 50; break; // ETHIOPIC NUMBER FIFTY |
|
707 |
case 0x1377: retval = 60; break; // ETHIOPIC NUMBER SIXTY |
|
708 |
case 0x1378: retval = 70; break; // ETHIOPIC NUMBER SEVENTY |
|
709 |
case 0x1379: retval = 80; break; // ETHIOPIC NUMBER EIGHTY |
|
710 |
case 0x137A: retval = 90; break; // ETHIOPIC NUMBER NINETY |
|
711 |
case 0x137B: retval = 100; break; // ETHIOPIC NUMBER HUNDRED |
|
712 |
case 0x137C: retval = 10000; break; // ETHIOPIC NUMBER TEN THOUSAND |
|
713 |
case 0x215F: retval = 1; break; // FRACTION NUMERATOR ONE |
|
714 |
case 0x216C: retval = 50; break; // ROMAN NUMERAL FIFTY |
|
715 |
case 0x216D: retval = 100; break; // ROMAN NUMERAL ONE HUNDRED |
|
716 |
case 0x216E: retval = 500; break; // ROMAN NUMERAL FIVE HUNDRED |
|
717 |
case 0x216F: retval = 1000; break; // ROMAN NUMERAL ONE THOUSAND |
|
718 |
case 0x217C: retval = 50; break; // SMALL ROMAN NUMERAL FIFTY |
|
719 |
case 0x217D: retval = 100; break; // SMALL ROMAN NUMERAL ONE HUNDRED |
|
720 |
case 0x217E: retval = 500; break; // SMALL ROMAN NUMERAL FIVE HUNDRED |
|
721 |
case 0x217F: retval = 1000; break; // SMALL ROMAN NUMERAL ONE THOUSAND |
|
722 |
case 0x2180: retval = 1000; break; // ROMAN NUMERAL ONE THOUSAND C D |
|
723 |
case 0x2181: retval = 5000; break; // ROMAN NUMERAL FIVE THOUSAND |
|
724 |
case 0x2182: retval = 10000; break; // ROMAN NUMERAL TEN THOUSAND |
|
33242 | 725 |
case 0x2186: retval = 50; break; // ROMAN NUMERAL FIFTY EARLY FORM |
726 |
case 0x2187: retval = 50000; break; // ROMAN NUMERAL FIFTY THOUSAND |
|
727 |
case 0x2188: retval = 100000; break; // ROMAN NUMERAL ONE HUNDRED THOUSAND |
|
728 |
case 0x324B: retval = 40; break; // CIRCLED NUMBER FORTY ON BLACK SQUARE |
|
729 |
case 0x324C: retval = 50; break; // CIRCLED NUMBER FIFTY ON BLACK SQUARE |
|
730 |
case 0x324D: retval = 60; break; // CIRCLED NUMBER SIXTY ON BLACK SQUARE |
|
731 |
case 0x324E: retval = 70; break; // CIRCLED NUMBER SEVENTY ON BLACK SQUARE |
|
732 |
case 0x324F: retval = 80; break; // CIRCLED NUMBER EIGHTY ON BLACK SQUARE |
|
733 |
case 0x325C: retval = 32; break; // CIRCLED NUMBER THIRTY TWO |
|
2 | 734 |
case 0x325D: retval = 33; break; // CIRCLED NUMBER THIRTY THREE |
735 |
case 0x325E: retval = 34; break; // CIRCLED NUMBER THIRTY FOUR |
|
736 |
case 0x325F: retval = 35; break; // CIRCLED NUMBER THIRTY FIVE |
|
737 |
case 0x32B1: retval = 36; break; // CIRCLED NUMBER THIRTY SIX |
|
738 |
case 0x32B2: retval = 37; break; // CIRCLED NUMBER THIRTY SEVEN |
|
739 |
case 0x32B3: retval = 38; break; // CIRCLED NUMBER THIRTY EIGHT |
|
740 |
case 0x32B4: retval = 39; break; // CIRCLED NUMBER THIRTY NINE |
|
741 |
case 0x32B5: retval = 40; break; // CIRCLED NUMBER FORTY |
|
742 |
case 0x32B6: retval = 41; break; // CIRCLED NUMBER FORTY ONE |
|
743 |
case 0x32B7: retval = 42; break; // CIRCLED NUMBER FORTY TWO |
|
744 |
case 0x32B8: retval = 43; break; // CIRCLED NUMBER FORTY THREE |
|
745 |
case 0x32B9: retval = 44; break; // CIRCLED NUMBER FORTY FOUR |
|
746 |
case 0x32BA: retval = 45; break; // CIRCLED NUMBER FORTY FIVE |
|
747 |
case 0x32BB: retval = 46; break; // CIRCLED NUMBER FORTY SIX |
|
748 |
case 0x32BC: retval = 47; break; // CIRCLED NUMBER FORTY SEVEN |
|
749 |
case 0x32BD: retval = 48; break; // CIRCLED NUMBER FORTY EIGHT |
|
750 |
case 0x32BE: retval = 49; break; // CIRCLED NUMBER FORTY NINE |
|
751 |
case 0x32BF: retval = 50; break; // CIRCLED NUMBER FIFTY |
|
752 |
default: retval = -2; break; |
|
753 |
} |
|
754 |
break; |
|
755 |
case ($$valueJavaSupradecimal): // Java supradecimal |
|
756 |
retval = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10; |
|
757 |
break; |
|
758 |
} |
|
759 |
return retval; |
|
760 |
} |
|
761 |
||
52979
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
762 |
boolean isDigit(int ch) { |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
763 |
int props = getProperties(ch); |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
764 |
return (props & $$maskType) == Character.DECIMAL_DIGIT_NUMBER; |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
765 |
} |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
766 |
|
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
767 |
boolean isLowerCase(int ch) { |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
768 |
int props = getProperties(ch); |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
769 |
return (props & $$maskType) == Character.LOWERCASE_LETTER; |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
770 |
} |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
771 |
|
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
772 |
boolean isUpperCase(int ch) { |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
773 |
int props = getProperties(ch); |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
774 |
return (props & $$maskType) == Character.UPPERCASE_LETTER; |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
775 |
} |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52633
diff
changeset
|
776 |
|
2 | 777 |
boolean isWhitespace(int ch) { |
778 |
int props = getProperties(ch); |
|
779 |
return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace); |
|
780 |
} |
|
781 |
||
782 |
byte getDirectionality(int ch) { |
|
783 |
int val = getProperties(ch); |
|
784 |
byte directionality = (byte)((val & $$maskBidi) >> $$shiftBidi); |
|
785 |
if (directionality == 0xF ) { |
|
786 |
switch(ch) { |
|
787 |
case 0x202A : |
|
788 |
// This is the only char with LRE |
|
789 |
directionality = Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING; |
|
790 |
break; |
|
791 |
case 0x202B : |
|
792 |
// This is the only char with RLE |
|
793 |
directionality = Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING; |
|
794 |
break; |
|
795 |
case 0x202C : |
|
796 |
// This is the only char with PDF |
|
797 |
directionality = Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT; |
|
798 |
break; |
|
799 |
case 0x202D : |
|
800 |
// This is the only char with LRO |
|
801 |
directionality = Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE; |
|
802 |
break; |
|
803 |
case 0x202E : |
|
804 |
// This is the only char with RLO |
|
805 |
directionality = Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE; |
|
806 |
break; |
|
31680 | 807 |
case 0x2066 : |
808 |
// This is the only char with LRI |
|
809 |
directionality = Character.DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE; |
|
810 |
break; |
|
811 |
case 0x2067 : |
|
812 |
// This is the only char with RLI |
|
813 |
directionality = Character.DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE; |
|
814 |
break; |
|
815 |
case 0x2068 : |
|
816 |
// This is the only char with FSI |
|
817 |
directionality = Character.DIRECTIONALITY_FIRST_STRONG_ISOLATE; |
|
818 |
break; |
|
819 |
case 0x2069 : |
|
820 |
// This is the only char with PDI |
|
821 |
directionality = Character.DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE; |
|
822 |
break; |
|
2 | 823 |
default : |
824 |
directionality = Character.DIRECTIONALITY_UNDEFINED; |
|
825 |
break; |
|
826 |
} |
|
827 |
} |
|
828 |
return directionality; |
|
829 |
} |
|
830 |
||
831 |
boolean isMirrored(int ch) { |
|
832 |
int props = getProperties(ch); |
|
833 |
return ((props & $$maskMirrored) != 0); |
|
834 |
} |
|
835 |
||
836 |
int toUpperCaseEx(int ch) { |
|
837 |
int mapChar = ch; |
|
838 |
int val = getProperties(ch); |
|
839 |
||
840 |
if ((val & $$maskUpperCase) != 0) { |
|
841 |
if ((val & $$maskCaseOffset) != $$maskCaseOffset) { |
|
842 |
int offset = val << $$shiftCaseOffsetSign >> ($$shiftCaseOffsetSign+$$shiftCaseOffset); |
|
843 |
mapChar = ch - offset; |
|
844 |
} |
|
845 |
else { |
|
846 |
switch(ch) { |
|
33242 | 847 |
case 0x017F: mapChar = 0x0053; break; |
848 |
case 0x023F: mapChar = 0x2C7E; break; |
|
849 |
case 0x0240: mapChar = 0x2C7F; break; |
|
850 |
case 0x0250: mapChar = 0x2C6F; break; |
|
851 |
case 0x0251: mapChar = 0x2C6D; break; |
|
852 |
case 0x0252: mapChar = 0x2C70; break; |
|
853 |
case 0x025C: mapChar = 0xA7AB; break; |
|
854 |
case 0x0261: mapChar = 0xA7AC; break; |
|
855 |
case 0x0265: mapChar = 0xA78D; break; |
|
856 |
case 0x0266: mapChar = 0xA7AA; break; |
|
50045 | 857 |
case 0x026A: mapChar = 0xA7AE; break; |
33242 | 858 |
case 0x026B: mapChar = 0x2C62; break; |
859 |
case 0x026C: mapChar = 0xA7AD; break; |
|
860 |
case 0x0271: mapChar = 0x2C6E; break; |
|
861 |
case 0x027D: mapChar = 0x2C64; break; |
|
55013 | 862 |
case 0x0282: mapChar = 0xA7C5; break; |
33242 | 863 |
case 0x0287: mapChar = 0xA7B1; break; |
864 |
case 0x029D: mapChar = 0xA7B2; break; |
|
865 |
case 0x029E: mapChar = 0xA7B0; break; |
|
52633 | 866 |
case 0x10D0: mapChar = 0x1C90; break; |
867 |
case 0x10D1: mapChar = 0x1C91; break; |
|
868 |
case 0x10D2: mapChar = 0x1C92; break; |
|
869 |
case 0x10D3: mapChar = 0x1C93; break; |
|
870 |
case 0x10D4: mapChar = 0x1C94; break; |
|
871 |
case 0x10D5: mapChar = 0x1C95; break; |
|
872 |
case 0x10D6: mapChar = 0x1C96; break; |
|
873 |
case 0x10D7: mapChar = 0x1C97; break; |
|
874 |
case 0x10D8: mapChar = 0x1C98; break; |
|
875 |
case 0x10D9: mapChar = 0x1C99; break; |
|
876 |
case 0x10DA: mapChar = 0x1C9A; break; |
|
877 |
case 0x10DB: mapChar = 0x1C9B; break; |
|
878 |
case 0x10DC: mapChar = 0x1C9C; break; |
|
879 |
case 0x10DD: mapChar = 0x1C9D; break; |
|
880 |
case 0x10DE: mapChar = 0x1C9E; break; |
|
881 |
case 0x10DF: mapChar = 0x1C9F; break; |
|
882 |
case 0x10E0: mapChar = 0x1CA0; break; |
|
883 |
case 0x10E1: mapChar = 0x1CA1; break; |
|
884 |
case 0x10E2: mapChar = 0x1CA2; break; |
|
885 |
case 0x10E3: mapChar = 0x1CA3; break; |
|
886 |
case 0x10E4: mapChar = 0x1CA4; break; |
|
887 |
case 0x10E5: mapChar = 0x1CA5; break; |
|
888 |
case 0x10E6: mapChar = 0x1CA6; break; |
|
889 |
case 0x10E7: mapChar = 0x1CA7; break; |
|
890 |
case 0x10E8: mapChar = 0x1CA8; break; |
|
891 |
case 0x10E9: mapChar = 0x1CA9; break; |
|
892 |
case 0x10EA: mapChar = 0x1CAA; break; |
|
893 |
case 0x10EB: mapChar = 0x1CAB; break; |
|
894 |
case 0x10EC: mapChar = 0x1CAC; break; |
|
895 |
case 0x10ED: mapChar = 0x1CAD; break; |
|
896 |
case 0x10EE: mapChar = 0x1CAE; break; |
|
897 |
case 0x10EF: mapChar = 0x1CAF; break; |
|
898 |
case 0x10F0: mapChar = 0x1CB0; break; |
|
899 |
case 0x10F1: mapChar = 0x1CB1; break; |
|
900 |
case 0x10F2: mapChar = 0x1CB2; break; |
|
901 |
case 0x10F3: mapChar = 0x1CB3; break; |
|
902 |
case 0x10F4: mapChar = 0x1CB4; break; |
|
903 |
case 0x10F5: mapChar = 0x1CB5; break; |
|
904 |
case 0x10F6: mapChar = 0x1CB6; break; |
|
905 |
case 0x10F7: mapChar = 0x1CB7; break; |
|
906 |
case 0x10F8: mapChar = 0x1CB8; break; |
|
907 |
case 0x10F9: mapChar = 0x1CB9; break; |
|
908 |
case 0x10FA: mapChar = 0x1CBA; break; |
|
909 |
case 0x10FD: mapChar = 0x1CBD; break; |
|
910 |
case 0x10FE: mapChar = 0x1CBE; break; |
|
911 |
case 0x10FF: mapChar = 0x1CBF; break; |
|
50045 | 912 |
case 0x1C80: mapChar = 0x0412; break; |
913 |
case 0x1C81: mapChar = 0x0414; break; |
|
914 |
case 0x1C82: mapChar = 0x041E; break; |
|
915 |
case 0x1C83: mapChar = 0x0421; break; |
|
916 |
case 0x1C84: mapChar = 0x0422; break; |
|
917 |
case 0x1C85: mapChar = 0x0422; break; |
|
918 |
case 0x1C86: mapChar = 0x042A; break; |
|
919 |
case 0x1C87: mapChar = 0x0462; break; |
|
920 |
case 0x1C88: mapChar = 0xA64A; break; |
|
33242 | 921 |
case 0x1D79: mapChar = 0xA77D; break; |
922 |
case 0x1D7D: mapChar = 0x2C63; break; |
|
55013 | 923 |
case 0x1D8E: mapChar = 0xA7C6; break; |
33242 | 924 |
case 0x1FBE: mapChar = 0x0399; break; |
925 |
case 0x2C65: mapChar = 0x023A; break; |
|
926 |
case 0x2C66: mapChar = 0x023E; break; |
|
927 |
case 0x2D00: mapChar = 0x10A0; break; |
|
928 |
case 0x2D01: mapChar = 0x10A1; break; |
|
929 |
case 0x2D02: mapChar = 0x10A2; break; |
|
930 |
case 0x2D03: mapChar = 0x10A3; break; |
|
931 |
case 0x2D04: mapChar = 0x10A4; break; |
|
932 |
case 0x2D05: mapChar = 0x10A5; break; |
|
933 |
case 0x2D06: mapChar = 0x10A6; break; |
|
934 |
case 0x2D07: mapChar = 0x10A7; break; |
|
935 |
case 0x2D08: mapChar = 0x10A8; break; |
|
936 |
case 0x2D09: mapChar = 0x10A9; break; |
|
937 |
case 0x2D0A: mapChar = 0x10AA; break; |
|
938 |
case 0x2D0B: mapChar = 0x10AB; break; |
|
939 |
case 0x2D0C: mapChar = 0x10AC; break; |
|
940 |
case 0x2D0D: mapChar = 0x10AD; break; |
|
941 |
case 0x2D0E: mapChar = 0x10AE; break; |
|
942 |
case 0x2D0F: mapChar = 0x10AF; break; |
|
943 |
case 0x2D10: mapChar = 0x10B0; break; |
|
944 |
case 0x2D11: mapChar = 0x10B1; break; |
|
945 |
case 0x2D12: mapChar = 0x10B2; break; |
|
946 |
case 0x2D13: mapChar = 0x10B3; break; |
|
947 |
case 0x2D14: mapChar = 0x10B4; break; |
|
948 |
case 0x2D15: mapChar = 0x10B5; break; |
|
949 |
case 0x2D16: mapChar = 0x10B6; break; |
|
950 |
case 0x2D17: mapChar = 0x10B7; break; |
|
951 |
case 0x2D18: mapChar = 0x10B8; break; |
|
952 |
case 0x2D19: mapChar = 0x10B9; break; |
|
953 |
case 0x2D1A: mapChar = 0x10BA; break; |
|
954 |
case 0x2D1B: mapChar = 0x10BB; break; |
|
955 |
case 0x2D1C: mapChar = 0x10BC; break; |
|
956 |
case 0x2D1D: mapChar = 0x10BD; break; |
|
957 |
case 0x2D1E: mapChar = 0x10BE; break; |
|
958 |
case 0x2D1F: mapChar = 0x10BF; break; |
|
959 |
case 0x2D20: mapChar = 0x10C0; break; |
|
960 |
case 0x2D21: mapChar = 0x10C1; break; |
|
961 |
case 0x2D22: mapChar = 0x10C2; break; |
|
962 |
case 0x2D23: mapChar = 0x10C3; break; |
|
963 |
case 0x2D24: mapChar = 0x10C4; break; |
|
964 |
case 0x2D25: mapChar = 0x10C5; break; |
|
965 |
case 0x2D27: mapChar = 0x10C7; break; |
|
966 |
case 0x2D2D: mapChar = 0x10CD; break; |
|
967 |
case 0xAB53: mapChar = 0xA7B3; break; |
|
968 |
case 0xAB70: mapChar = 0x13A0; break; |
|
969 |
case 0xAB71: mapChar = 0x13A1; break; |
|
970 |
case 0xAB72: mapChar = 0x13A2; break; |
|
971 |
case 0xAB73: mapChar = 0x13A3; break; |
|
972 |
case 0xAB74: mapChar = 0x13A4; break; |
|
973 |
case 0xAB75: mapChar = 0x13A5; break; |
|
974 |
case 0xAB76: mapChar = 0x13A6; break; |
|
975 |
case 0xAB77: mapChar = 0x13A7; break; |
|
976 |
case 0xAB78: mapChar = 0x13A8; break; |
|
977 |
case 0xAB79: mapChar = 0x13A9; break; |
|
978 |
case 0xAB7A: mapChar = 0x13AA; break; |
|
979 |
case 0xAB7B: mapChar = 0x13AB; break; |
|
980 |
case 0xAB7C: mapChar = 0x13AC; break; |
|
981 |
case 0xAB7D: mapChar = 0x13AD; break; |
|
982 |
case 0xAB7E: mapChar = 0x13AE; break; |
|
983 |
case 0xAB7F: mapChar = 0x13AF; break; |
|
984 |
case 0xAB80: mapChar = 0x13B0; break; |
|
985 |
case 0xAB81: mapChar = 0x13B1; break; |
|
986 |
case 0xAB82: mapChar = 0x13B2; break; |
|
987 |
case 0xAB83: mapChar = 0x13B3; break; |
|
988 |
case 0xAB84: mapChar = 0x13B4; break; |
|
989 |
case 0xAB85: mapChar = 0x13B5; break; |
|
990 |
case 0xAB86: mapChar = 0x13B6; break; |
|
991 |
case 0xAB87: mapChar = 0x13B7; break; |
|
992 |
case 0xAB88: mapChar = 0x13B8; break; |
|
993 |
case 0xAB89: mapChar = 0x13B9; break; |
|
994 |
case 0xAB8A: mapChar = 0x13BA; break; |
|
995 |
case 0xAB8B: mapChar = 0x13BB; break; |
|
996 |
case 0xAB8C: mapChar = 0x13BC; break; |
|
997 |
case 0xAB8D: mapChar = 0x13BD; break; |
|
998 |
case 0xAB8E: mapChar = 0x13BE; break; |
|
999 |
case 0xAB8F: mapChar = 0x13BF; break; |
|
1000 |
case 0xAB90: mapChar = 0x13C0; break; |
|
1001 |
case 0xAB91: mapChar = 0x13C1; break; |
|
1002 |
case 0xAB92: mapChar = 0x13C2; break; |
|
1003 |
case 0xAB93: mapChar = 0x13C3; break; |
|
1004 |
case 0xAB94: mapChar = 0x13C4; break; |
|
1005 |
case 0xAB95: mapChar = 0x13C5; break; |
|
1006 |
case 0xAB96: mapChar = 0x13C6; break; |
|
1007 |
case 0xAB97: mapChar = 0x13C7; break; |
|
1008 |
case 0xAB98: mapChar = 0x13C8; break; |
|
1009 |
case 0xAB99: mapChar = 0x13C9; break; |
|
1010 |
case 0xAB9A: mapChar = 0x13CA; break; |
|
1011 |
case 0xAB9B: mapChar = 0x13CB; break; |
|
1012 |
case 0xAB9C: mapChar = 0x13CC; break; |
|
1013 |
case 0xAB9D: mapChar = 0x13CD; break; |
|
1014 |
case 0xAB9E: mapChar = 0x13CE; break; |
|
1015 |
case 0xAB9F: mapChar = 0x13CF; break; |
|
1016 |
case 0xABA0: mapChar = 0x13D0; break; |
|
1017 |
case 0xABA1: mapChar = 0x13D1; break; |
|
1018 |
case 0xABA2: mapChar = 0x13D2; break; |
|
1019 |
case 0xABA3: mapChar = 0x13D3; break; |
|
1020 |
case 0xABA4: mapChar = 0x13D4; break; |
|
1021 |
case 0xABA5: mapChar = 0x13D5; break; |
|
1022 |
case 0xABA6: mapChar = 0x13D6; break; |
|
1023 |
case 0xABA7: mapChar = 0x13D7; break; |
|
1024 |
case 0xABA8: mapChar = 0x13D8; break; |
|
1025 |
case 0xABA9: mapChar = 0x13D9; break; |
|
1026 |
case 0xABAA: mapChar = 0x13DA; break; |
|
1027 |
case 0xABAB: mapChar = 0x13DB; break; |
|
1028 |
case 0xABAC: mapChar = 0x13DC; break; |
|
1029 |
case 0xABAD: mapChar = 0x13DD; break; |
|
1030 |
case 0xABAE: mapChar = 0x13DE; break; |
|
1031 |
case 0xABAF: mapChar = 0x13DF; break; |
|
1032 |
case 0xABB0: mapChar = 0x13E0; break; |
|
1033 |
case 0xABB1: mapChar = 0x13E1; break; |
|
1034 |
case 0xABB2: mapChar = 0x13E2; break; |
|
1035 |
case 0xABB3: mapChar = 0x13E3; break; |
|
1036 |
case 0xABB4: mapChar = 0x13E4; break; |
|
1037 |
case 0xABB5: mapChar = 0x13E5; break; |
|
1038 |
case 0xABB6: mapChar = 0x13E6; break; |
|
1039 |
case 0xABB7: mapChar = 0x13E7; break; |
|
1040 |
case 0xABB8: mapChar = 0x13E8; break; |
|
1041 |
case 0xABB9: mapChar = 0x13E9; break; |
|
1042 |
case 0xABBA: mapChar = 0x13EA; break; |
|
1043 |
case 0xABBB: mapChar = 0x13EB; break; |
|
1044 |
case 0xABBC: mapChar = 0x13EC; break; |
|
1045 |
case 0xABBD: mapChar = 0x13ED; break; |
|
1046 |
case 0xABBE: mapChar = 0x13EE; break; |
|
1047 |
case 0xABBF: mapChar = 0x13EF; break; |
|
2 | 1048 |
default : mapChar = Character.ERROR; break; |
1049 |
} |
|
1050 |
} |
|
1051 |
} |
|
1052 |
return mapChar; |
|
1053 |
} |
|
1054 |
||
1055 |
char[] toUpperCaseCharArray(int ch) { |
|
1056 |
char[] upperMap = {(char)ch}; |
|
1057 |
int location = findInCharMap(ch); |
|
1058 |
if (location != -1) { |
|
1059 |
upperMap = charMap[location][1]; |
|
1060 |
} |
|
1061 |
return upperMap; |
|
1062 |
} |
|
1063 |
||
1064 |
||
1065 |
/** |
|
1066 |
* Finds the character in the uppercase mapping table. |
|
1067 |
* |
|
1068 |
* @param ch the <code>char</code> to search |
|
1069 |
* @return the index location ch in the table or -1 if not found |
|
1070 |
* @since 1.4 |
|
1071 |
*/ |
|
1072 |
int findInCharMap(int ch) { |
|
1073 |
if (charMap == null || charMap.length == 0) { |
|
1074 |
return -1; |
|
1075 |
} |
|
1076 |
int top, bottom, current; |
|
1077 |
bottom = 0; |
|
1078 |
top = charMap.length; |
|
1079 |
current = top/2; |
|
1080 |
// invariant: top > current >= bottom && ch >= CharacterData.charMap[bottom][0] |
|
1081 |
while (top - bottom > 1) { |
|
1082 |
if (ch >= charMap[current][0][0]) { |
|
1083 |
bottom = current; |
|
1084 |
} else { |
|
1085 |
top = current; |
|
1086 |
} |
|
1087 |
current = (top + bottom) / 2; |
|
1088 |
} |
|
1089 |
if (ch == charMap[current][0][0]) return current; |
|
1090 |
else return -1; |
|
1091 |
} |
|
1092 |
||
1093 |
static final CharacterData00 instance = new CharacterData00(); |
|
1094 |
private CharacterData00() {}; |
|
1095 |
||
1096 |
$$Tables |
|
1097 |
||
1098 |
static { |
|
1099 |
$$Initializers |
|
52633 | 1100 |
} |
2 | 1101 |
} |