KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > icu > lang > UScript


1 /**
2 *******************************************************************************
3 * Copyright (C) 2001-2006, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
6 */

7
8 package com.ibm.icu.lang;
9
10 import com.ibm.icu.impl.ICUResourceBundle;
11 import com.ibm.icu.impl.UCharacterProperty;
12 import com.ibm.icu.util.ULocale;
13 import com.ibm.icu.util.UResourceBundle;
14
15 import java.util.Locale JavaDoc;
16 import java.util.MissingResourceException JavaDoc;
17
18 /**
19  * A class to reflect UTR #24: Script Names
20  * (based on ISO 15924:2000, "Code for the representation of names of
21  * scripts"). UTR #24 describes the basis for a new Unicode data file,
22  * Scripts.txt.
23  * @stable ICU 2.4
24  */

25 public final class UScript {
26     /**
27      * Puts a copyright in the .class file
28      */

29     private static final String JavaDoc copyrightNotice
30         = "Copyright \u00a92001 IBM Corp. All rights reserved.";
31
32     /**
33      * Invalid code
34      * @stable ICU 2.4
35      */

36     public static final int INVALID_CODE = -1;
37     /**
38      * Common
39      * @stable ICU 2.4
40      */

41     public static final int COMMON = 0; /* Zyyy */
42     /**
43      * Inherited
44      * @stable ICU 2.4
45      */

46     public static final int INHERITED = 1; /* Qaai */
47     /**
48      * Arabic
49      * @stable ICU 2.4
50      */

51     public static final int ARABIC = 2; /* Arab */
52     /**
53      * Armenian
54      * @stable ICU 2.4
55      */

56     public static final int ARMENIAN = 3; /* Armn */
57     /**
58      * Bengali
59      * @stable ICU 2.4
60      */

61     public static final int BENGALI = 4; /* Beng */
62     /**
63      * Bopomofo
64      * @stable ICU 2.4
65      */

66     public static final int BOPOMOFO = 5; /* Bopo */
67     /**
68      * Cherokee
69      * @stable ICU 2.4
70      */

71     public static final int CHEROKEE = 6; /* Cher */
72     /**
73      * Coptic
74      * @stable ICU 2.4
75      */

76     public static final int COPTIC = 7; /* Qaac */
77     /**
78      * Cyrillic
79      * @stable ICU 2.4
80      */

81     public static final int CYRILLIC = 8; /* Cyrl (Cyrs) */
82     /**
83      * Deseret
84      * @stable ICU 2.4
85      */

86     public static final int DESERET = 9; /* Dsrt */
87     /**
88      * Devanagari
89      * @stable ICU 2.4
90      */

91     public static final int DEVANAGARI = 10; /* Deva */
92     /**
93      * Ethiopic
94      * @stable ICU 2.4
95      */

96     public static final int ETHIOPIC = 11; /* Ethi */
97     /**
98      * Georgian
99      * @stable ICU 2.4
100      */

101     public static final int GEORGIAN = 12; /* Geor (Geon; Geoa) */
102     /**
103      * Gothic
104      * @stable ICU 2.4
105      */

106     public static final int GOTHIC = 13; /* Goth */
107     /**
108      * Greek
109      * @stable ICU 2.4
110      */

111     public static final int GREEK = 14; /* Grek */
112     /**
113      * Gujarati
114      * @stable ICU 2.4
115      */

116     public static final int GUJARATI = 15; /* Gujr */
117     /**
118      * Gurmukhi
119      * @stable ICU 2.4
120      */

121     public static final int GURMUKHI = 16; /* Guru */
122     /**
123      * Han
124      * @stable ICU 2.4
125      */

126     public static final int HAN = 17; /* Hani */
127     /**
128      * Hangul
129      * @stable ICU 2.4
130      */

131     public static final int HANGUL = 18; /* Hang */
132     /**
133      * Hebrew
134      * @stable ICU 2.4
135      */

136     public static final int HEBREW = 19; /* Hebr */
137     /**
138      * Hiragana
139      * @stable ICU 2.4
140      */

141     public static final int HIRAGANA = 20; /* Hira */
142     /**
143      * Kannada
144      * @stable ICU 2.4
145      */

146     public static final int KANNADA = 21; /* Knda */
147     /**
148      * Katakana
149      * @stable ICU 2.4
150      */

151     public static final int KATAKANA = 22; /* Kana */
152     /**
153      * Khmer
154      * @stable ICU 2.4
155      */

156     public static final int KHMER = 23; /* Khmr */
157     /**
158      * Lao
159      * @stable ICU 2.4
160      */

161     public static final int LAO = 24; /* Laoo */
162     /**
163      * Latin
164      * @stable ICU 2.4
165      */

166     public static final int LATIN = 25; /* Latn (Latf; Latg) */
167     /**
168      * Malayalam
169      * @stable ICU 2.4
170      */

171     public static final int MALAYALAM = 26; /* Mlym */
172     /**
173      * Mangolian
174      * @stable ICU 2.4
175      */

176     public static final int MONGOLIAN = 27; /* Mong */
177     /**
178      * Myammar
179      * @stable ICU 2.4
180      */

181     public static final int MYANMAR = 28; /* Mymr */
182     /**
183      * Ogham
184      * @stable ICU 2.4
185      */

186     public static final int OGHAM = 29; /* Ogam */
187     /**
188      * Old Itallic
189      * @stable ICU 2.4
190      */

191     public static final int OLD_ITALIC = 30; /* Ital */
192     /**
193      * Oriya
194      * @stable ICU 2.4
195      */

196     public static final int ORIYA = 31; /* Orya */
197     /**
198      * Runic
199      * @stable ICU 2.4
200      */

201     public static final int RUNIC = 32; /* Runr */
202     /**
203      * Sinhala
204      * @stable ICU 2.4
205      */

206     public static final int SINHALA = 33; /* Sinh */
207     /**
208      * Syriac
209      * @stable ICU 2.4
210      */

211     public static final int SYRIAC = 34; /* Syrc (Syrj; Syrn; Syre) */
212     /**
213      * Tamil
214      * @stable ICU 2.4
215      */

216     public static final int TAMIL = 35; /* Taml */
217     /**
218      * Telugu
219      * @stable ICU 2.4
220      */

221     public static final int TELUGU = 36; /* Telu */
222     /**
223      * Thana
224      * @stable ICU 2.4
225      */

226     public static final int THAANA = 37; /* Thaa */
227     /**
228      * Thai
229      * @stable ICU 2.4
230      */

231     public static final int THAI = 38; /* Thai */
232     /**
233      * Tibetan
234      * @stable ICU 2.4
235      */

236     public static final int TIBETAN = 39; /* Tibt */
237     /**
238      * Unified Canadian Aboriginal Symbols
239      * @stable ICU 2.6
240      */

241     public static final int CANADIAN_ABORIGINAL = 40; /* Cans */
242     /**
243      * Unified Canadian Aboriginal Symbols (alias)
244      * @stable ICU 2.4
245      */

246     public static final int UCAS = CANADIAN_ABORIGINAL; /* Cans */
247     /**
248      * Yi syllables
249      * @stable ICU 2.4
250      */

251     public static final int YI = 41; /* Yiii */
252     /**
253      * Tagalog
254      * @stable ICU 2.4
255      */

256     public static final int TAGALOG = 42; /* Tglg */
257     /**
258      * Hanunooo
259      * @stable ICU 2.4
260      */

261     public static final int HANUNOO = 43; /* Hano */
262     /**
263      * Buhid
264      * @stable ICU 2.4
265      */

266     public static final int BUHID = 44; /* Buhd */
267     /**
268      * Tagbanwa
269      * @stable ICU 2.4
270      */

271     public static final int TAGBANWA = 45; /* Tagb */
272     /**
273      * Braille
274      * New script in Unicode 4
275      * @stable ICU 2.6
276      *
277      */

278     public static final int BRAILLE = 46; /* Brai */
279     /**
280      * Cypriot
281      * New script in Unicode 4
282      * @stable ICU 2.6
283      *
284      */

285     public static final int CYPRIOT = 47; /* Cprt */
286     /**
287      * Limbu
288      * New script in Unicode 4
289      * @stable ICU 2.6
290      *
291      */

292     public static final int LIMBU = 48; /* Limb */
293     /**
294      * Linear B
295      * New script in Unicode 4
296      * @stable ICU 2.6
297      *
298      */

299     public static final int LINEAR_B = 49; /* Linb */
300     /**
301      * Osmanya
302      * New script in Unicode 4
303      * @stable ICU 2.6
304      *
305      */

306     public static final int OSMANYA = 50; /* Osma */
307     /**
308      * Shavian
309      * New script in Unicode 4
310      * @stable ICU 2.6
311      *
312      */

313     public static final int SHAVIAN = 51; /* Shaw */
314     /**
315      * Tai Le
316      * New script in Unicode 4
317      * @stable ICU 2.6
318      *
319      */

320     public static final int TAI_LE = 52; /* Tale */
321     /**
322      * Ugaritic
323      * New script in Unicode 4
324      * @stable ICU 2.6
325      *
326      */

327     public static final int UGARITIC = 53; /* Ugar */
328     /**
329      * New script code in Unicode 4.0.1
330      * @stable ICU 3.0
331      */

332     public static final int KATAKANA_OR_HIRAGANA = 54; /*Hrkt */
333
334     /* New scripts in Unicode 4.1 @draft ICU 3.4 */
335
336     /**
337      * New script code in Unicode 4.1
338      * @draft ICU 3.4
339      * @provisional This API might change or be removed in a future release.
340      */

341     public static final int BUGINESE = 55; /* Bugi */
342     /**
343      * New script code in Unicode 4.1
344      * @draft ICU 3.4
345      * @provisional This API might change or be removed in a future release.
346      */

347     public static final int GLAGOLITIC = 56; /* Glag */
348     /**
349      * New script code in Unicode 4.1
350      * @draft ICU 3.4
351      * @provisional This API might change or be removed in a future release.
352      */

353     public static final int KHAROSHTHI = 57; /* Khar */
354     /**
355      * New script code in Unicode 4.1
356      * @draft ICU 3.4
357      * @provisional This API might change or be removed in a future release.
358      */

359     public static final int SYLOTI_NAGRI = 58; /* Sylo */
360     /**
361      * New script code in Unicode 4.1
362      * @draft ICU 3.4
363      * @provisional This API might change or be removed in a future release.
364      */

365     public static final int NEW_TAI_LUE = 59; /* Talu */
366     /**
367      * New script code in Unicode 4.1
368      * @draft ICU 3.4
369      * @provisional This API might change or be removed in a future release.
370      */

371     public static final int TIFINAGH = 60; /* Tfng */
372     /**
373      * New script code in Unicode 4.1
374      * @draft ICU 3.4
375      * @provisional This API might change or be removed in a future release.
376      */

377     public static final int OLD_PERSIAN = 61; /* Xpeo */
378
379
380     /**
381      * New script codes from ISO 15924
382      * @draft ICU 3.6
383      * @provisional This API might change or be removed in a future release.
384      */

385     public static final int BALINESE = 62; /* Bali */
386     /**
387      * New script codes from ISO 15924
388      * @draft ICU 3.6
389      * @provisional This API might change or be removed in a future release.
390      */

391     public static final int BATAK = 63; /* Batk */
392     /**
393      * New script codes from ISO 15924
394      * @draft ICU 3.6
395      * @provisional This API might change or be removed in a future release.
396      */

397     public static final int BLISSYMBOLS = 64; /* Blis */
398     /**
399      * New script codes from ISO 15924
400      * @draft ICU 3.6
401      * @provisional This API might change or be removed in a future release.
402      */

403     public static final int BRAHMI = 65; /* Brah */
404     /**
405      * New script codes from ISO 15924
406      * @draft ICU 3.6
407      * @provisional This API might change or be removed in a future release.
408      */

409     public static final int CHAM = 66; /* Cham */
410     /**
411      * New script codes from ISO 15924
412      * @draft ICU 3.6
413      * @provisional This API might change or be removed in a future release.
414      */

415     public static final int CIRTH = 67; /* Cirt */
416     /**
417      * New script codes from ISO 15924
418      * @draft ICU 3.6
419      * @provisional This API might change or be removed in a future release.
420      */

421     public static final int OLD_CHURCH_SLAVONIC_CYRILLIC = 68; /* Cyrs */
422     /**
423      * New script codes from ISO 15924
424      * @draft ICU 3.6
425      * @provisional This API might change or be removed in a future release.
426      */

427     public static final int DEMOTIC_EGYPTIAN = 69; /* Egyd */
428     /**
429      * New script codes from ISO 15924
430      * @draft ICU 3.6
431      * @provisional This API might change or be removed in a future release.
432      */

433     public static final int HIERATIC_EGYPTIAN = 70; /* Egyh */
434     /**
435      * New script codes from ISO 15924
436      * @draft ICU 3.6
437      * @provisional This API might change or be removed in a future release.
438      */

439     public static final int EGYPTIAN_HIEROGLYPHS = 71; /* Egyp */
440     /**
441      * New script codes from ISO 15924
442      * @draft ICU 3.6
443      * @provisional This API might change or be removed in a future release.
444      */

445     public static final int KHUTSURI = 72; /* Geok */
446     /**
447      * New script codes from ISO 15924
448      * @draft ICU 3.6
449      * @provisional This API might change or be removed in a future release.
450      */

451     public static final int SIMPLIFIED_HAN = 73; /* Hans */
452     /**
453      * New script codes from ISO 15924
454      * @draft ICU 3.6
455      * @provisional This API might change or be removed in a future release.
456      */

457     public static final int TRADITIONAL_HAN = 74; /* Hant */
458     /**
459      * New script codes from ISO 15924
460      * @draft ICU 3.6
461      * @provisional This API might change or be removed in a future release.
462      */

463     public static final int PAHAWH_HMONG = 75; /* Hmng */
464     /**
465      * New script codes from ISO 15924
466      * @draft ICU 3.6
467      * @provisional This API might change or be removed in a future release.
468      */

469     public static final int OLD_HUNGARIAN = 76; /* Hung */
470     /**
471      * New script codes from ISO 15924
472      * @draft ICU 3.6
473      * @provisional This API might change or be removed in a future release.
474      */

475     public static final int HARAPPAN_INDUS = 77; /* Inds */
476     /**
477      * New script codes from ISO 15924
478      * @draft ICU 3.6
479      * @provisional This API might change or be removed in a future release.
480      */

481     public static final int JAVANESE = 78; /* Java */
482     /**
483      * New script codes from ISO 15924
484      * @draft ICU 3.6
485      * @provisional This API might change or be removed in a future release.
486      */

487     public static final int KAYAH_LI = 79; /* Kali */
488     /**
489      * New script codes from ISO 15924
490      * @draft ICU 3.6
491      * @provisional This API might change or be removed in a future release.
492      */

493     public static final int LATIN_FRAKTUR = 80; /* Latf */
494     /**
495      * New script codes from ISO 15924
496      * @draft ICU 3.6
497      * @provisional This API might change or be removed in a future release.
498      */

499     public static final int LATIN_GAELIC = 81; /* Latg */
500     /**
501      * New script codes from ISO 15924
502      * @draft ICU 3.6
503      * @provisional This API might change or be removed in a future release.
504      */

505     public static final int LEPCHA = 82; /* Lepc */
506     /**
507      * New script codes from ISO 15924
508      * @draft ICU 3.6
509      * @provisional This API might change or be removed in a future release.
510      */

511     public static final int LINEAR_A = 83; /* Lina */
512     /**
513      * New script codes from ISO 15924
514      * @draft ICU 3.6
515      * @provisional This API might change or be removed in a future release.
516      */

517     public static final int MANDAEAN = 84; /* Mand */
518     /**
519      * New script codes from ISO 15924
520      * @draft ICU 3.6
521      * @provisional This API might change or be removed in a future release.
522      */

523     public static final int MAYAN_HIEROGLYPHS = 85; /* Maya */
524     /**
525      * New script codes from ISO 15924
526      * @draft ICU 3.6
527      * @provisional This API might change or be removed in a future release.
528      */

529     public static final int MEROITIC = 86; /* Mero */
530     /**
531      * New script codes from ISO 15924
532      * @draft ICU 3.6
533      * @provisional This API might change or be removed in a future release.
534      */

535     public static final int NKO = 87; /* Nkoo */
536     /**
537      * New script codes from ISO 15924
538      * @draft ICU 3.6
539      * @provisional This API might change or be removed in a future release.
540      */

541     public static final int ORKHON = 88; /* Orkh */
542     /**
543      * New script codes from ISO 15924
544      * @draft ICU 3.6
545      * @provisional This API might change or be removed in a future release.
546      */

547     public static final int OLD_PERMIC = 89; /* Perm */
548     /**
549      * New script codes from ISO 15924
550      * @draft ICU 3.6
551      * @provisional This API might change or be removed in a future release.
552      */

553     public static final int PHAGS_PA = 90; /* Phag */
554     /**
555      * New script codes from ISO 15924
556      * @draft ICU 3.6
557      * @provisional This API might change or be removed in a future release.
558      */

559     public static final int PHOENICIAN = 91; /* Phnx */
560     /**
561      * New script codes from ISO 15924
562      * @draft ICU 3.6
563      * @provisional This API might change or be removed in a future release.
564      */

565     public static final int PHONETIC_POLLARD = 92; /* Plrd */
566     /**
567      * New script codes from ISO 15924
568      * @draft ICU 3.6
569      * @provisional This API might change or be removed in a future release.
570      */

571     public static final int RONGORONGO = 93; /* Roro */
572     /**
573      * New script codes from ISO 15924
574      * @draft ICU 3.6
575      * @provisional This API might change or be removed in a future release.
576      */

577     public static final int SARATI = 94; /* Sara */
578     /**
579      * New script codes from ISO 15924
580      * @draft ICU 3.6
581      * @provisional This API might change or be removed in a future release.
582      */

583     public static final int ESTRANGELO_SYRIAC = 95; /* Syre */
584     /**
585      * New script codes from ISO 15924
586      * @draft ICU 3.6
587      * @provisional This API might change or be removed in a future release.
588      */

589     public static final int WESTERN_SYRIAC = 96; /* Syrj */
590     /**
591      * New script codes from ISO 15924
592      * @draft ICU 3.6
593      * @provisional This API might change or be removed in a future release.
594      */

595     public static final int EASTERN_SYRIAC = 97; /* Syrn */
596     /**
597      * New script codes from ISO 15924
598      * @draft ICU 3.6
599      * @provisional This API might change or be removed in a future release.
600      */

601     public static final int TENGWAR = 98; /* Teng */
602     /**
603      * New script codes from ISO 15924
604      * @draft ICU 3.6
605      * @provisional This API might change or be removed in a future release.
606      */

607     public static final int VAI = 99; /* Vaii */
608     /**
609      * New script codes from ISO 15924
610      * @draft ICU 3.6
611      * @provisional This API might change or be removed in a future release.
612      */

613     public static final int VISIBLE_SPEECH = 100;/* Visp */
614     /**
615      * New script codes from ISO 15924
616      * @draft ICU 3.6
617      * @provisional This API might change or be removed in a future release.
618      */

619     public static final int CUNEIFORM = 101;/* Xsux */
620     /**
621      * New script codes from ISO 15924
622      * @draft ICU 3.6
623      * @provisional This API might change or be removed in a future release.
624      */

625     public static final int UNWRITTEN_LANGUAGES = 102;/* Zxxx */
626     /**
627      * New script codes from ISO 15924
628      * @draft ICU 3.6
629      * @provisional This API might change or be removed in a future release.
630      */

631     public static final int UNKNOWN = 103;/* Zzzz */ /* Unknown="Code for uncoded script", for unassigned code points */
632     
633     /* Private use codes from Qaaa - Qabx are not supported*/
634
635     /**
636      * Limit
637      * @stable ICU 2.4
638      */

639     public static final int CODE_LIMIT = 104;
640
641     private static final int SCRIPT_MASK = 0x0000007f;
642     private static final UCharacterProperty prop= UCharacterProperty.getInstance();
643     private static final String JavaDoc kLocaleScript = "LocaleScript";
644     
645     //private static final String INVALID_NAME = "Invalid";
646
/**
647      * Helper function to find the code from locale.
648      * @param locale The locale.
649      */

650     private static int[] findCodeFromLocale(ULocale locale) {
651         ICUResourceBundle rb;
652         try {
653             rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
654         }
655         catch (MissingResourceException JavaDoc e) {
656             return null;
657         }
658         
659         // if rb is not a strict fallback of the requested locale, return null
660
//if(!LocaleUtility.isFallbackOf(rb.getULocale().toString(), locale.toString())){
661
// return null;
662
//}
663
//non existent locale check
664
if(rb.getLoadingStatus()==ICUResourceBundle.FROM_DEFAULT && ! locale.equals(ULocale.getDefault())){
665             return null;
666         }
667         ICUResourceBundle sub = rb.get(kLocaleScript);
668         
669         int[] result = new int[sub.getSize()];
670         int w = 0;
671         for (int i = 0; i < result.length; ++i) {
672             int code = UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
673                                                        sub.getString(i));
674             result[w++] = code;
675
676         }
677
678         if (w < result.length) {
679             throw new IllegalStateException JavaDoc("bad locale data, listed " +
680                  result.length + " scripts but found only " + w);
681         }
682
683         return result;
684     }
685
686     /**
687      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
688      * Returns MALAYAM given "Malayam" OR "Mlym".
689      * Returns LATIN given "en" OR "en_US"
690      * @param locale Locale
691      * @return The script codes array. null if the the code cannot be found.
692      * @stable ICU 2.4
693      */

694     public static final int[] getCode(Locale locale){
695         return findCodeFromLocale(ULocale.forLocale(locale));
696     }
697     /**
698      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
699      * Returns MALAYAM given "Malayam" OR "Mlym".
700      * Returns LATIN given "en" OR "en_US"
701      * @param locale ULocale
702      * @return The script codes array. null if the the code cannot be found.
703      * @stable ICU 3.0
704      */

705     public static final int[] getCode(ULocale locale){
706         return findCodeFromLocale(locale);
707     }
708     /**
709      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
710      * Returns MALAYAM given "Malayam" OR "Mlym".
711      * Returns LATIN given "en" OR "en_US"
712      *
713      * <p>Note: To search by short or long script alias only, use
714      * UCharacater.getPropertyValueEnum(UProperty.SCRIPT, alias)
715      * instead. This does a fast lookup with no access of the locale
716      * data.
717      * @param nameOrAbbrOrLocale name of the script or ISO 15924 code or locale
718      * @return The script codes array. null if the the code cannot be found.
719      * @stable ICU 2.4
720      */

721     public static final int[] getCode(String JavaDoc nameOrAbbrOrLocale){
722         try {
723             return new int[] {
724                 UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
725                                                 nameOrAbbrOrLocale)
726             };
727         } catch (IllegalArgumentException JavaDoc e) {
728             return findCodeFromLocale(new ULocale(nameOrAbbrOrLocale));
729         }
730     }
731
732     /**
733      * Gets a script codes associated with the given ISO 15924 abbreviation or name.
734      * Returns MALAYAM given "Malayam" OR "Mlym".
735      *
736      * @param nameOrAbbr name of the script or ISO 15924 code
737      * @return The script code value or INVALID_CODE if the code cannot be found.
738      * @internal
739      * @deprecated This API is ICU internal only.
740      */

741     public static final int getCodeFromName(String JavaDoc nameOrAbbr) {
742         try {
743             return UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
744                                                    nameOrAbbr);
745         } catch (IllegalArgumentException JavaDoc e) {
746             return INVALID_CODE;
747         }
748     }
749
750     /**
751      * Gets the script code associated with the given codepoint.
752      * Returns UScript.MALAYAM given 0x0D02
753      * @param codepoint UChar32 codepoint
754      * @return The script code
755      * @stable ICU 2.4
756      */

757     public static final int getScript(int codepoint){
758         if (codepoint >= UCharacter.MIN_VALUE & codepoint <= UCharacter.MAX_VALUE) {
759             return (prop.getAdditional(codepoint,0) & SCRIPT_MASK);
760         }else{
761             throw new IllegalArgumentException JavaDoc(Integer.toString(codepoint));
762         }
763     }
764
765     /**
766      * Gets a script name associated with the given script code.
767      * Returns "Malayam" given MALAYAM
768      * @param scriptCode int script code
769      * @return script name as a string in full as given in TR#24
770      * @stable ICU 2.4
771      */

772     public static final String JavaDoc getName(int scriptCode){
773         return UCharacter.getPropertyValueName(UProperty.SCRIPT,
774                                                scriptCode,
775                                                UProperty.NameChoice.LONG);
776     }
777
778     /**
779      * Gets a script name associated with the given script code.
780      * Returns "Mlym" given MALAYAM
781      * @param scriptCode int script code
782      * @return script abbreviated name as a string as given in TR#24
783      * @stable ICU 2.4
784      */

785     public static final String JavaDoc getShortName(int scriptCode){
786         return UCharacter.getPropertyValueName(UProperty.SCRIPT,
787                                                scriptCode,
788                                                UProperty.NameChoice.SHORT);
789     }
790     ///CLOVER:OFF
791
/**
792      * Private Constructor. Never default construct
793      */

794     private UScript(){}
795     ///CLOVER:ON
796
}
797
798
Popular Tags