]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/lang/UScript.java
Clean up imports.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / lang / UScript.java
1 /**
2 *******************************************************************************
3 * Copyright (C) 2001-2013 International Business Machines Corporation and
4 * others. All Rights Reserved.
5 *******************************************************************************
6 */
7
8 package com.ibm.icu.lang;
9
10 import java.util.BitSet;
11 import java.util.Locale;
12 import java.util.MissingResourceException;
13
14 import com.ibm.icu.impl.ICUResourceBundle;
15 import com.ibm.icu.impl.UCharacterProperty;
16 import com.ibm.icu.util.ULocale;
17 import com.ibm.icu.util.UResourceBundle;
18
19 /**
20  * A class to reflect UTR #24: Script Names
21  * (based on ISO 15924:2000, "Code for the representation of names of
22  * scripts").  UTR #24 describes the basis for a new Unicode data file,
23  * Scripts.txt.
24  * @stable ICU 2.4
25  */
26 public final class UScript {
27     /**
28      * Invalid code
29      * @stable ICU 2.4
30      */
31     public static final int INVALID_CODE = -1;
32     /**
33      * Common
34      * @stable ICU 2.4
35      */
36     public static final int COMMON       =  0;  /* Zyyy */
37     /**
38      * Inherited
39      * @stable ICU 2.4
40      */
41     public static final int INHERITED    =  1;  /* Zinh */ /* "Code for inherited script", for non-spacing combining marks; also Qaai */
42     /**
43      * Arabic
44      * @stable ICU 2.4
45      */
46     public static final int ARABIC       =  2;  /* Arab */
47     /**
48      * Armenian
49      * @stable ICU 2.4
50      */
51     public static final int ARMENIAN     =  3;  /* Armn */
52     /**
53      * Bengali
54      * @stable ICU 2.4
55      */
56     public static final int BENGALI      =  4;  /* Beng */
57     /**
58      * Bopomofo
59      * @stable ICU 2.4
60      */
61     public static final int BOPOMOFO     =  5;  /* Bopo */
62     /**
63      * Cherokee
64      * @stable ICU 2.4
65      */
66     public static final int CHEROKEE     =  6;  /* Cher */
67     /**
68      * Coptic
69      * @stable ICU 2.4
70      */
71     public static final int COPTIC       =  7;  /* Qaac */
72     /**
73      * Cyrillic
74      * @stable ICU 2.4
75      */
76     public static final int CYRILLIC     =  8;  /* Cyrl (Cyrs) */
77     /**
78      * Deseret
79      * @stable ICU 2.4
80      */
81     public static final int DESERET      =  9;  /* Dsrt */
82     /**
83      * Devanagari
84      * @stable ICU 2.4
85      */
86     public static final int DEVANAGARI   = 10;  /* Deva */
87     /**
88      * Ethiopic
89      * @stable ICU 2.4
90      */
91     public static final int ETHIOPIC     = 11;  /* Ethi */
92     /**
93      * Georgian
94      * @stable ICU 2.4
95      */
96     public static final int GEORGIAN     = 12;  /* Geor (Geon; Geoa) */
97     /**
98      * Gothic
99      * @stable ICU 2.4
100      */
101     public static final int GOTHIC       = 13;  /* Goth */
102     /**
103      * Greek
104      * @stable ICU 2.4
105      */
106     public static final int GREEK        = 14;  /* Grek */
107     /**
108      * Gujarati
109      * @stable ICU 2.4
110      */
111     public static final int GUJARATI     = 15;  /* Gujr */
112     /**
113      * Gurmukhi
114      * @stable ICU 2.4
115      */
116     public static final int GURMUKHI     = 16;  /* Guru */
117     /**
118      * Han
119      * @stable ICU 2.4
120      */
121     public static final int HAN          = 17;  /* Hani */
122     /**
123      * Hangul
124      * @stable ICU 2.4
125      */
126     public static final int HANGUL       = 18;  /* Hang */
127     /**
128      * Hebrew
129      * @stable ICU 2.4
130      */
131     public static final int HEBREW       = 19;  /* Hebr */
132     /**
133      * Hiragana
134      * @stable ICU 2.4
135      */
136     public static final int HIRAGANA     = 20;  /* Hira */
137     /**
138      * Kannada
139      * @stable ICU 2.4
140      */
141     public static final int KANNADA      = 21;  /* Knda */
142     /**
143      * Katakana
144      * @stable ICU 2.4
145      */
146     public static final int KATAKANA     = 22;  /* Kana */
147     /**
148      * Khmer
149      * @stable ICU 2.4
150      */
151     public static final int KHMER        = 23;  /* Khmr */
152     /**
153      * Lao
154      * @stable ICU 2.4
155      */
156     public static final int LAO          = 24;  /* Laoo */
157     /**
158      * Latin
159      * @stable ICU 2.4
160      */
161     public static final int LATIN        = 25;  /* Latn (Latf; Latg) */
162     /**
163      * Malayalam
164      * @stable ICU 2.4
165      */
166     public static final int MALAYALAM    = 26;  /* Mlym */
167     /**
168      * Mangolian
169      * @stable ICU 2.4
170      */
171     public static final int MONGOLIAN    = 27;  /* Mong */
172     /**
173      * Myammar
174      * @stable ICU 2.4
175      */
176     public static final int MYANMAR      = 28;  /* Mymr */
177     /**
178      * Ogham
179      * @stable ICU 2.4
180      */
181     public static final int OGHAM        = 29;  /* Ogam */
182     /**
183      * Old Itallic
184      * @stable ICU 2.4
185      */
186     public static final int OLD_ITALIC   = 30;  /* Ital */
187     /**
188      * Oriya
189      * @stable ICU 2.4
190      */
191     public static final int ORIYA        = 31;  /* Orya */
192     /**
193      * Runic
194      * @stable ICU 2.4
195      */
196     public static final int RUNIC        = 32;  /* Runr */
197     /**
198      * Sinhala
199      * @stable ICU 2.4
200      */
201     public static final int SINHALA      = 33;  /* Sinh */
202     /**
203      * Syriac
204      * @stable ICU 2.4
205      */
206     public static final int SYRIAC       = 34;  /* Syrc (Syrj; Syrn; Syre) */
207     /**
208      * Tamil
209      * @stable ICU 2.4
210      */
211     public static final int TAMIL        = 35;  /* Taml */
212     /**
213      * Telugu
214      * @stable ICU 2.4
215      */
216     public static final int TELUGU       = 36;  /* Telu */
217     /**
218      * Thana
219      * @stable ICU 2.4
220      */
221     public static final int THAANA       = 37;  /* Thaa */
222     /**
223      * Thai
224      * @stable ICU 2.4
225      */
226     public static final int THAI         = 38;  /* Thai */
227     /**
228      * Tibetan
229      * @stable ICU 2.4
230      */
231     public static final int TIBETAN      = 39;  /* Tibt */
232     /**
233      * Unified Canadian Aboriginal Symbols
234      * @stable ICU 2.6
235      */
236     public static final int CANADIAN_ABORIGINAL = 40;  /* Cans */
237     /**
238      * Unified Canadian Aboriginal Symbols (alias)
239      * @stable ICU 2.4
240      */
241     public static final int UCAS         = CANADIAN_ABORIGINAL;  /* Cans */
242     /**
243      * Yi syllables
244      * @stable ICU 2.4
245      */
246     public static final int YI           = 41;  /* Yiii */
247     /**
248      * Tagalog
249      * @stable ICU 2.4
250      */
251     public static final int TAGALOG      = 42;  /* Tglg */
252     /**
253      * Hanunooo
254      * @stable ICU 2.4
255      */
256     public static final int HANUNOO      = 43;  /* Hano */
257     /**
258      * Buhid
259      * @stable ICU 2.4
260      */
261     public static final int BUHID        = 44;  /* Buhd */
262     /**
263      * Tagbanwa
264      * @stable ICU 2.4
265      */
266     public static final int TAGBANWA     = 45;  /* Tagb */
267     /**
268      * Braille
269      * Script in Unicode 4 
270      * @stable ICU 2.6 
271      * 
272      */ 
273     public static final int BRAILLE      = 46;  /* Brai */
274     /**
275      * Cypriot
276      * Script in Unicode 4 
277      * @stable ICU 2.6 
278      * 
279      */  
280     public static final int CYPRIOT              = 47;  /* Cprt */ 
281     /**
282      * Limbu
283      * Script in Unicode 4 
284      * @stable ICU 2.6 
285      * 
286      */       
287     public static final int LIMBU                = 48;  /* Limb */ 
288     /**
289      * Linear B
290      * Script in Unicode 4 
291      * @stable ICU 2.6 
292      * 
293      */ 
294     public static final int LINEAR_B     = 49;  /* Linb */ 
295     /**
296      * Osmanya
297      * Script in Unicode 4 
298      * @stable ICU 2.6 
299      * 
300      */ 
301     public static final int OSMANYA              = 50;  /* Osma */ 
302     /**
303      * Shavian
304      * Script in Unicode 4 
305      * @stable ICU 2.6 
306      * 
307      */ 
308     public static final int SHAVIAN              = 51;  /* Shaw */ 
309     /**
310      * Tai Le
311      * Script in Unicode 4 
312      * @stable ICU 2.6 
313      * 
314      */ 
315     public static final int TAI_LE               = 52;  /* Tale */ 
316     /**
317      * Ugaritic
318      * Script in Unicode 4 
319      * @stable ICU 2.6 
320      * 
321      */ 
322     public static final int UGARITIC     = 53;  /* Ugar */ 
323     /**
324      * Script in Unicode 4.0.1
325      * @stable ICU 3.0
326      */
327     public static final int KATAKANA_OR_HIRAGANA = 54;  /*Hrkt */
328
329     /**
330      * Script in Unicode 4.1
331      * @stable ICU 3.4
332      */
333     public static final int BUGINESE = 55;           /* Bugi */
334     /**
335      * Script in Unicode 4.1
336      * @stable ICU 3.4
337      */
338     public static final int GLAGOLITIC = 56;         /* Glag */
339     /**
340      * Script in Unicode 4.1
341      * @stable ICU 3.4
342      */
343     public static final int KHAROSHTHI = 57;         /* Khar */
344     /**
345      * Script in Unicode 4.1
346      * @stable ICU 3.4
347      */
348     public static final int SYLOTI_NAGRI = 58;       /* Sylo */
349     /**
350      * Script in Unicode 4.1
351      * @stable ICU 3.4
352      */
353     public static final int NEW_TAI_LUE = 59;        /* Talu */
354     /**
355      * Script in Unicode 4.1
356      * @stable ICU 3.4
357      */
358     public static final int TIFINAGH = 60;           /* Tfng */
359     /**
360      * Script in Unicode 4.1
361      * @stable ICU 3.4
362      */
363     public static final int OLD_PERSIAN = 61;        /* Xpeo */
364
365
366     /**
367      * ISO 15924 script code
368      * @stable ICU 3.6
369      */
370     public static final int BALINESE                      = 62; /* Bali */
371     /**
372      * ISO 15924 script code
373      * @stable ICU 3.6
374      */
375     public static final int BATAK                         = 63; /* Batk */
376     /**
377      * ISO 15924 script code
378      * @stable ICU 3.6
379      */
380     public static final int BLISSYMBOLS                   = 64; /* Blis */
381     /**
382      * ISO 15924 script code
383      * @stable ICU 3.6
384      */
385     public static final int BRAHMI                        = 65; /* Brah */
386     /**
387      * ISO 15924 script code
388      * @stable ICU 3.6
389      */
390     public static final int CHAM                          = 66; /* Cham */
391     /**
392      * ISO 15924 script code
393      * @stable ICU 3.6
394      */
395     public static final int CIRTH                         = 67; /* Cirt */
396     /**
397      * ISO 15924 script code
398      * @stable ICU 3.6
399      */
400     public static final int OLD_CHURCH_SLAVONIC_CYRILLIC  = 68; /* Cyrs */
401     /**
402      * ISO 15924 script code
403      * @stable ICU 3.6
404      */
405     public static final int DEMOTIC_EGYPTIAN              = 69; /* Egyd */
406     /**
407      * ISO 15924 script code
408      * @stable ICU 3.6
409      */
410     public static final int HIERATIC_EGYPTIAN             = 70; /* Egyh */
411     /**
412      * ISO 15924 script code
413      * @stable ICU 3.6
414      */
415     public static final int EGYPTIAN_HIEROGLYPHS          = 71; /* Egyp */
416     /**
417      * ISO 15924 script code
418      * @stable ICU 3.6
419      */
420     public static final int KHUTSURI                      = 72; /* Geok */
421     /**
422      * ISO 15924 script code
423      * @stable ICU 3.6
424      */
425     public static final int SIMPLIFIED_HAN                = 73; /* Hans */
426     /**
427      * ISO 15924 script code
428      * @stable ICU 3.6
429      */
430     public static final int TRADITIONAL_HAN               = 74; /* Hant */
431     /**
432      * ISO 15924 script code
433      * @stable ICU 3.6
434      */
435     public static final int PAHAWH_HMONG                  = 75; /* Hmng */
436     /**
437      * ISO 15924 script code
438      * @stable ICU 3.6
439      */
440     public static final int OLD_HUNGARIAN                 = 76; /* Hung */
441     /**
442      * ISO 15924 script code
443      * @stable ICU 3.6
444      */
445     public static final int HARAPPAN_INDUS                = 77; /* Inds */
446     /**
447      * ISO 15924 script code
448      * @stable ICU 3.6
449      */
450     public static final int JAVANESE                      = 78; /* Java */
451     /**
452      * ISO 15924 script code
453      * @stable ICU 3.6
454      */
455     public static final int KAYAH_LI                      = 79; /* Kali */
456     /**
457      * ISO 15924 script code
458      * @stable ICU 3.6
459      */
460     public static final int LATIN_FRAKTUR                 = 80; /* Latf */
461     /**
462      * ISO 15924 script code
463      * @stable ICU 3.6
464      */
465     public static final int LATIN_GAELIC                  = 81; /* Latg */
466     /**
467      * ISO 15924 script code
468      * @stable ICU 3.6
469      */
470     public static final int LEPCHA                        = 82; /* Lepc */
471     /**
472      * ISO 15924 script code
473      * @stable ICU 3.6
474      */
475     public static final int LINEAR_A                      = 83; /* Lina */
476     /**
477      * ISO 15924 script code
478      * @stable ICU 4.6
479      */
480     public static final int MANDAIC                       = 84; /* Mand */
481     /**
482      * ISO 15924 script code
483      * @stable ICU 3.6
484      */
485     public static final int MANDAEAN                      = MANDAIC;
486     /**
487      * ISO 15924 script code
488      * @stable ICU 3.6
489      */
490     public static final int MAYAN_HIEROGLYPHS             = 85; /* Maya */
491     /**
492      * ISO 15924 script code
493      * @stable ICU 4.6
494      */
495     public static final int MEROITIC_HIEROGLYPHS          = 86; /* Mero */
496     /**
497      * ISO 15924 script code
498      * @stable ICU 3.6
499      */
500     public static final int MEROITIC                      = MEROITIC_HIEROGLYPHS;
501     /**
502      * ISO 15924 script code
503      * @stable ICU 3.6
504      */
505     public static final int NKO                           = 87; /* Nkoo */
506     /**
507      * ISO 15924 script code
508      * @stable ICU 3.6
509      */
510     public static final int ORKHON                        = 88; /* Orkh */
511     /**
512      * ISO 15924 script code
513      * @stable ICU 3.6
514      */
515     public static final int OLD_PERMIC                    = 89; /* Perm */
516     /**
517      * ISO 15924 script code
518      * @stable ICU 3.6
519      */
520     public static final int PHAGS_PA                      = 90; /* Phag */
521     /**
522      * ISO 15924 script code
523      * @stable ICU 3.6
524      */
525     public static final int PHOENICIAN                    = 91; /* Phnx */
526     /**
527      * ISO 15924 script code
528      * @stable ICU 52
529      */
530     public static final int MIAO                          = 92; /* Plrd */
531     /**
532      * ISO 15924 script code
533      * @stable ICU 3.6
534      */
535     public static final int PHONETIC_POLLARD              = MIAO;
536     /**
537      * ISO 15924 script code
538      * @stable ICU 3.6
539      */
540     public static final int RONGORONGO                    = 93; /* Roro */
541     /**
542      * ISO 15924 script code
543      * @stable ICU 3.6
544      */
545     public static final int SARATI                        = 94; /* Sara */
546     /**
547      * ISO 15924 script code
548      * @stable ICU 3.6
549      */
550     public static final int ESTRANGELO_SYRIAC             = 95; /* Syre */
551     /**
552      * ISO 15924 script code
553      * @stable ICU 3.6
554      */
555     public static final int WESTERN_SYRIAC                = 96; /* Syrj */
556     /**
557      * ISO 15924 script code
558      * @stable ICU 3.6
559      */
560     public static final int EASTERN_SYRIAC                = 97; /* Syrn */
561     /**
562      * ISO 15924 script code
563      * @stable ICU 3.6
564      */
565     public static final int TENGWAR                       = 98; /* Teng */
566     /**
567      * ISO 15924 script code
568      * @stable ICU 3.6
569      */
570     public static final int VAI                           = 99; /* Vaii */
571     /**
572      * ISO 15924 script code
573      * @stable ICU 3.6
574      */
575     public static final int VISIBLE_SPEECH                = 100;/* Visp */
576     /**
577      * ISO 15924 script code
578      * @stable ICU 3.6
579      */
580     public static final int CUNEIFORM                     = 101;/* Xsux */
581     /**
582      * ISO 15924 script code
583      * @stable ICU 3.6
584      */
585     public static final int UNWRITTEN_LANGUAGES           = 102;/* Zxxx */
586     /**
587      * ISO 15924 script code
588      * @stable ICU 3.6
589      */
590     public static final int UNKNOWN                       = 103;/* Zzzz */ /* Unknown="Code for uncoded script", for unassigned code points */
591     
592     /**
593      * ISO 15924 script code
594      * @stable ICU 3.8
595      */ 
596     public static final int CARIAN                        = 104;/* Cari */
597     /**
598      * ISO 15924 script code
599      * @stable ICU 3.8
600      */
601     public static final int JAPANESE                      = 105;/* Jpan */
602     /**
603      * ISO 15924 script code
604      * @stable ICU 3.8
605      */
606     public static final int LANNA                         = 106;/* Lana */
607     /**
608      * ISO 15924 script code
609      * @stable ICU 3.8
610      */
611     public static final int LYCIAN                        = 107;/* Lyci */
612     /**
613      * ISO 15924 script code
614      * @stable ICU 3.8
615      */
616     public static final int LYDIAN                        = 108;/* Lydi */
617     /**
618      * ISO 15924 script code
619      * @stable ICU 3.8
620      */
621     public static final int OL_CHIKI                      = 109;/* Olck */
622     /**
623      * ISO 15924 script code
624      * @stable ICU 3.8
625      */
626     public static final int REJANG                        = 110;/* Rjng */
627     /**
628      * ISO 15924 script code
629      * @stable ICU 3.8
630      */
631     public static final int SAURASHTRA                    = 111;/* Saur */
632     /**
633      * ISO 15924 script code
634      * @stable ICU 3.8
635      */
636     public static final int SIGN_WRITING                  = 112;/* Sgnw */
637     /**
638      * ISO 15924 script code
639      * @stable ICU 3.8
640      */
641     public static final int SUNDANESE                     = 113;/* Sund */
642     /**
643      * ISO 15924 script code
644      * @stable ICU 3.8
645      */
646     public static final int MOON                          = 114;/* Moon */
647     /**
648      * ISO 15924 script code
649      * @stable ICU 3.8
650      */
651     public static final int MEITEI_MAYEK                  = 115;/* Mtei */
652     
653     /**
654      * ISO 15924 script code
655      * @stable ICU 4.0
656      */
657     public static final int IMPERIAL_ARAMAIC              = 116;/* Armi */
658
659     /**
660      * ISO 15924 script code
661      * @stable ICU 4.0
662      */
663     public static final int AVESTAN                       = 117;/* Avst */
664
665     /**
666      * ISO 15924 script code
667      * @stable ICU 4.0
668      */
669     public static final int CHAKMA                        = 118;/* Cakm */
670
671     /**
672      * ISO 15924 script code
673      * @stable ICU 4.0
674      */
675     public static final int KOREAN                        = 119;/* Kore */
676
677     /**
678      * ISO 15924 script code
679      * @stable ICU 4.0
680      */
681     public static final int KAITHI                        = 120;/* Kthi */
682
683     /**
684      * ISO 15924 script code
685      * @stable ICU 4.0
686      */
687     public static final int MANICHAEAN                    = 121;/* Mani */
688
689     /**
690      * ISO 15924 script code
691      * @stable ICU 4.0
692      */
693     public static final int INSCRIPTIONAL_PAHLAVI         = 122;/* Phli */
694
695     /**
696      * ISO 15924 script code
697      * @stable ICU 4.0
698      */
699     public static final int PSALTER_PAHLAVI               = 123;/* Phlp */
700
701     /**
702      * ISO 15924 script code
703      * @stable ICU 4.0
704      */
705     public static final int BOOK_PAHLAVI                  = 124;/* Phlv */
706
707     /**
708      * ISO 15924 script code
709      * @stable ICU 4.0
710      */
711     public static final int INSCRIPTIONAL_PARTHIAN        = 125;/* Prti */
712
713     /**
714      * ISO 15924 script code
715      * @stable ICU 4.0
716      */
717     public static final int SAMARITAN                     = 126;/* Samr */
718
719     /**
720      * ISO 15924 script code
721      * @stable ICU 4.0
722      */
723     public static final int TAI_VIET                      = 127;/* Tavt */
724
725     /**
726      * ISO 15924 script code
727      * @stable ICU 4.0
728      */
729     public static final int MATHEMATICAL_NOTATION         = 128;/* Zmth */
730
731     /**
732      * ISO 15924 script code
733      * @stable ICU 4.0
734      */
735     public static final int SYMBOLS                       = 129;/* Zsym */
736
737     /**
738      * ISO 15924 script code
739      * @stable ICU 4.4
740      */
741     public static final int BAMUM                         = 130;/* Bamu */
742     /**
743      * ISO 15924 script code
744      * @stable ICU 4.4
745      */
746     public static final int LISU                          = 131;/* Lisu */
747     /**
748      * ISO 15924 script code
749      * @stable ICU 4.4
750      */
751     public static final int NAKHI_GEBA                    = 132;/* Nkgb */
752     /**
753      * ISO 15924 script code
754      * @stable ICU 4.4
755      */
756     public static final int OLD_SOUTH_ARABIAN             = 133;/* Sarb */
757
758     /**
759      * ISO 15924 script code
760      * @stable ICU 4.6
761      */
762     public static final int BASSA_VAH                     = 134;/* Bass */
763     /**
764      * ISO 15924 script code
765      * @stable ICU 4.6
766      */
767     public static final int DUPLOYAN_SHORTAND             = 135;/* Dupl */
768     /**
769      * ISO 15924 script code
770      * @stable ICU 4.6
771      */
772     public static final int ELBASAN                       = 136;/* Elba */
773     /**
774      * ISO 15924 script code
775      * @stable ICU 4.6
776      */
777     public static final int GRANTHA                       = 137;/* Gran */
778     /**
779      * ISO 15924 script code
780      * @stable ICU 4.6
781      */
782     public static final int KPELLE                        = 138;/* Kpel */
783     /**
784      * ISO 15924 script code
785      * @stable ICU 4.6
786      */
787     public static final int LOMA                          = 139;/* Loma */
788     /**
789      * ISO 15924 script code
790      * @stable ICU 4.6
791      */
792     public static final int MENDE                         = 140;/* Mend */
793     /**
794      * ISO 15924 script code
795      * @stable ICU 4.6
796      */
797     public static final int MEROITIC_CURSIVE              = 141;/* Merc */
798     /**
799      * ISO 15924 script code
800      * @stable ICU 4.6
801      */
802     public static final int OLD_NORTH_ARABIAN             = 142;/* Narb */
803     /**
804      * ISO 15924 script code
805      * @stable ICU 4.6
806      */
807     public static final int NABATAEAN                     = 143;/* Nbat */
808     /**
809      * ISO 15924 script code
810      * @stable ICU 4.6
811      */
812     public static final int PALMYRENE                     = 144;/* Palm */
813     /**
814      * ISO 15924 script code
815      * @stable ICU 4.6
816      */
817     public static final int SINDHI                        = 145;/* Sind */
818     /**
819      * ISO 15924 script code
820      * @stable ICU 4.6
821      */
822     public static final int WARANG_CITI                   = 146;/* Wara */
823
824     /**
825      * ISO 15924 script code
826      * @stable ICU 4.8
827      */
828     public static final int AFAKA = 147;/* Afak */
829     /**
830      * ISO 15924 script code
831      * @stable ICU 4.8
832      */
833     public static final int JURCHEN = 148;/* Jurc */
834     /**
835      * ISO 15924 script code
836      * @stable ICU 4.8
837      */
838     public static final int MRO = 149;/* Mroo */
839     /**
840      * ISO 15924 script code
841      * @stable ICU 4.8
842      */
843     public static final int NUSHU = 150;/* Nshu */
844     /**
845      * ISO 15924 script code
846      * @stable ICU 4.8
847      */
848     public static final int SHARADA = 151;/* Shrd */
849     /**
850      * ISO 15924 script code
851      * @stable ICU 4.8
852      */
853     public static final int SORA_SOMPENG = 152;/* Sora */
854     /**
855      * ISO 15924 script code
856      * @stable ICU 4.8
857      */
858     public static final int TAKRI = 153;/* Takr */
859     /**
860      * ISO 15924 script code
861      * @stable ICU 4.8
862      */
863     public static final int TANGUT = 154;/* Tang */
864     /**
865      * ISO 15924 script code
866      * @stable ICU 4.8
867      */
868     public static final int WOLEAI = 155;/* Wole */
869
870     /**
871      * ISO 15924 script code
872      * @stable ICU 49
873      */
874     public static final int ANATOLIAN_HIEROGLYPHS = 156;/* Hluw */
875     /**
876      * ISO 15924 script code
877      * @stable ICU 49
878      */
879     public static final int KHOJKI = 157;/* Khoj */
880     /**
881      * ISO 15924 script code
882      * @stable ICU 49
883      */
884     public static final int TIRHUTA = 158;/* Tirh */
885     /**
886      * ISO 15924 script code
887      * @stable ICU 52
888      */
889     public static final int CAUCASIAN_ALBANIAN = 159; /* Aghb */
890     /**
891      * ISO 15924 script code
892      * @stable ICU 52
893      */
894     public static final int MAHAJANI = 160; /* Mahj */
895
896     /* Private use codes from Qaaa - Qabx are not supported */
897
898     /**
899      * One higher than the last ISO 15924 script code integer.
900      * This value will increase as ISO 15924 adds script codes
901      * for which integer constants are added above.
902      * @stable ICU 2.4
903      */
904     public static final int CODE_LIMIT   = 161;
905
906     private static final String kLocaleScript = "LocaleScript";
907     
908     //private static final String INVALID_NAME = "Invalid";
909     /**
910      * Helper function to find the code from locale.
911      * @param locale The locale.
912      */
913     private static int[] findCodeFromLocale(ULocale locale) {
914         ICUResourceBundle rb;
915         
916         try {
917             rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
918         } catch (MissingResourceException e) {
919             /* This part seems to never be called since "UResourceBundle.getBundleInstance"
920              * corrects this by setting to ICUResourceBundle.FROM_DEFAULT
921              * when such an invalid locale is passed.
922              */
923             ///CLOVER:OFF
924             return null;
925             ///CLOVER:ON
926         }
927         
928         rb = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
929         
930         // if rb is not a strict fallback of the requested locale, return null
931         //if(!LocaleUtility.isFallbackOf(rb.getULocale().toString(), locale.toString())){
932         //    return null;
933         //}
934         //non existent locale check
935         if(rb.getLoadingStatus()==ICUResourceBundle.FROM_DEFAULT && ! locale.equals(ULocale.getDefault())){
936             return null;
937         }
938         UResourceBundle sub = rb.get(kLocaleScript);
939         
940         int[] result = new int[sub.getSize()];
941         int w = 0;
942         for (int i = 0; i < result.length; ++i) {
943             int code = UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
944                                                        sub.getString(i));
945             result[w++] = code;
946
947         }
948
949         if (w < result.length) {
950             throw new IllegalStateException("bad locale data, listed " + 
951                  result.length + " scripts but found only " + w);
952         }
953
954         return result;
955     }
956
957     /**
958      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
959      * Returns MALAYAM given "Malayam" OR "Mlym".
960      * Returns LATIN given "en" OR "en_US"
961      * @param locale Locale
962      * @return The script codes array. null if the the code cannot be found.
963      * @stable ICU 2.4
964      */
965     public static final int[] getCode(Locale locale){
966         return findCodeFromLocale(ULocale.forLocale(locale));
967     }
968     /**
969      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
970      * Returns MALAYAM given "Malayam" OR "Mlym".
971      * Returns LATIN given "en" OR "en_US"
972      * @param locale ULocale
973      * @return The script codes array. null if the the code cannot be found.
974      * @stable ICU 3.0
975      */
976     public static final int[] getCode(ULocale locale){
977         return findCodeFromLocale(locale);
978     }
979     /**
980      * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name.
981      * Returns MALAYAM given "Malayam" OR "Mlym".
982      * Returns LATIN given "en" OR "en_US"
983      *
984      * <p>Note: To search by short or long script alias only, use
985      * UCharacater.getPropertyValueEnum(UProperty.SCRIPT, alias)
986      * instead.  This does a fast lookup with no access of the locale
987      * data.
988      * @param nameOrAbbrOrLocale name of the script or ISO 15924 code or locale
989      * @return The script codes array. null if the the code cannot be found.
990      * @stable ICU 2.4
991      */
992     public static final int[] getCode(String nameOrAbbrOrLocale){
993         try {
994             return new int[] {
995                 UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
996                                                 nameOrAbbrOrLocale)
997             };
998         } catch (IllegalArgumentException e) {
999             return findCodeFromLocale(new ULocale(nameOrAbbrOrLocale));
1000         }
1001     }
1002
1003     /**
1004      * Gets a script codes associated with the given ISO 15924 abbreviation or name.
1005      * Returns MALAYAM given "Malayam" OR "Mlym".
1006      *
1007      * @param nameOrAbbr name of the script or ISO 15924 code
1008      * @return The script code value or INVALID_CODE if the code cannot be found.
1009      * @internal
1010      * @deprecated This API is ICU internal only.
1011      */
1012     public static final int getCodeFromName(String nameOrAbbr) {
1013         try {
1014             return UCharacter.getPropertyValueEnum(UProperty.SCRIPT,
1015                                                    nameOrAbbr);
1016         } catch (IllegalArgumentException e) {
1017             return INVALID_CODE;
1018         }
1019     }
1020
1021     /**
1022      * Gets the script code associated with the given codepoint.
1023      * Returns UScript.MALAYAM given 0x0D02
1024      * @param codepoint UChar32 codepoint
1025      * @return The script code
1026      * @stable ICU 2.4
1027      */
1028     public static final int getScript(int codepoint){
1029         if (codepoint >= UCharacter.MIN_VALUE & codepoint <= UCharacter.MAX_VALUE) {
1030             int scriptX=UCharacterProperty.INSTANCE.getAdditional(codepoint, 0)&UCharacterProperty.SCRIPT_X_MASK;
1031             if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
1032                 return scriptX;
1033             } else if(scriptX<UCharacterProperty.SCRIPT_X_WITH_INHERITED) {
1034                 return UScript.COMMON;
1035             } else if(scriptX<UCharacterProperty.SCRIPT_X_WITH_OTHER) {
1036                 return UScript.INHERITED;
1037             } else {
1038                 return UCharacterProperty.INSTANCE.m_scriptExtensions_[scriptX&UCharacterProperty.SCRIPT_MASK_];
1039             }
1040         }else{
1041             throw new IllegalArgumentException(Integer.toString(codepoint));
1042         }
1043     }
1044
1045     /**
1046      * Do the Script_Extensions of code point c contain script sc?
1047      * If c does not have explicit Script_Extensions, then this tests whether
1048      * c has the Script property value sc.
1049      *
1050      * <p>Some characters are commonly used in multiple scripts.
1051      * For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
1052      *
1053      * <p>The Script_Extensions property is provisional. It may be modified or removed
1054      * in future versions of the Unicode Standard, and thus in ICU.
1055      * @param c code point
1056      * @param sc script code
1057      * @return true if sc is in Script_Extensions(c)
1058      * @stable ICU 49
1059      */
1060     public static final boolean hasScript(int c, int sc) {
1061         int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
1062         if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
1063             return sc==scriptX;
1064         }
1065
1066         char[] scriptExtensions=UCharacterProperty.INSTANCE.m_scriptExtensions_;
1067         int scx=scriptX&UCharacterProperty.SCRIPT_MASK_;  // index into scriptExtensions
1068         if(scriptX>=UCharacterProperty.SCRIPT_X_WITH_OTHER) {
1069             scx=scriptExtensions[scx+1];
1070         }
1071         if(sc>0x7fff) {
1072             // Guard against bogus input that would
1073             // make us go past the Script_Extensions terminator.
1074             return false;
1075         }
1076         while(sc>scriptExtensions[scx]) {
1077             ++scx;
1078         }
1079         return sc==(scriptExtensions[scx]&0x7fff);
1080     }
1081
1082     /**
1083      * Sets code point c's Script_Extensions as script code integers into the output BitSet.
1084      * <ul>
1085      * <li>If c does have Script_Extensions, then the return value is
1086      * the negative number of Script_Extensions codes (= -set.cardinality());
1087      * in this case, the Script property value
1088      * (normally Common or Inherited) is not included in the set.
1089      * <li>If c does not have Script_Extensions, then the one Script code is put into the set
1090      * and also returned.
1091      * <li>If c is not a valid code point, then the one {@link #UNKNOWN} code is put into the set
1092      * and also returned.
1093      * </ul>
1094      * In other words, if the return value is non-negative, it is c's single Script code
1095      * and the set contains exactly this Script code.
1096      * If the return value is -n, then the set contains c's n>=2 Script_Extensions script codes.
1097      *
1098      * <p>Some characters are commonly used in multiple scripts.
1099      * For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
1100      *
1101      * <p>The Script_Extensions property is provisional. It may be modified or removed
1102      * in future versions of the Unicode Standard, and thus in ICU.
1103      * @param c code point
1104      * @param set set of script code integers; will be cleared, then bits are set
1105      *            corresponding to c's Script_Extensions
1106      * @return negative number of script codes in c's Script_Extensions,
1107      *         or the non-negative single Script value
1108      * @stable ICU 49
1109      */
1110     public static final int getScriptExtensions(int c, BitSet set) {
1111         set.clear();
1112         int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
1113         if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
1114             set.set(scriptX);
1115             return scriptX;
1116         }
1117
1118         char[] scriptExtensions=UCharacterProperty.INSTANCE.m_scriptExtensions_;
1119         int scx=scriptX&UCharacterProperty.SCRIPT_MASK_;  // index into scriptExtensions
1120         if(scriptX>=UCharacterProperty.SCRIPT_X_WITH_OTHER) {
1121             scx=scriptExtensions[scx+1];
1122         }
1123         int length=0;
1124         int sx;
1125         do {
1126             sx=scriptExtensions[scx++];
1127             set.set(sx&0x7fff);
1128             ++length;
1129         } while(sx<0x8000);
1130         // length==set.cardinality()
1131         return -length;
1132     }
1133
1134     /**
1135      * Gets a script name associated with the given script code.
1136      * Returns  "Malayam" given MALAYAM
1137      * @param scriptCode int script code
1138      * @return script name as a string in full as given in TR#24
1139      * @stable ICU 2.4
1140      */
1141     public static final String getName(int scriptCode){
1142         return UCharacter.getPropertyValueName(UProperty.SCRIPT,
1143                                                scriptCode,
1144                                                UProperty.NameChoice.LONG);
1145     }
1146
1147     /**
1148      * Gets a script name associated with the given script code.
1149      * Returns  "Mlym" given MALAYAM
1150      * @param scriptCode int script code
1151      * @return script abbreviated name as a string  as given in TR#24
1152      * @stable ICU 2.4
1153      */
1154     public static final String getShortName(int scriptCode){
1155         return UCharacter.getPropertyValueName(UProperty.SCRIPT,
1156                                                scriptCode,
1157                                                UProperty.NameChoice.SHORT);
1158     }
1159
1160     /**
1161      * Script metadata (script properties).
1162      * See http://unicode.org/cldr/trac/browser/trunk/common/properties/scriptMetadata.txt
1163      */
1164     private static final class ScriptMetadata {
1165         // 0 = NOT_ENCODED, no sample character, default false script properties.
1166         // Bits 20.. 0: sample character
1167     
1168         // Bits 23..21: usage
1169         private static final int UNKNOWN = 1 << 21;
1170         private static final int EXCLUSION = 2 << 21;
1171         private static final int LIMITED_USE = 3 << 21;
1172         private static final int ASPIRATIONAL = 4 << 21;
1173         private static final int RECOMMENDED = 5 << 21;
1174     
1175         // Bits 31..24: Single-bit flags
1176         private static final int RTL = 1 << 24;
1177         private static final int LB_LETTERS = 1 << 25;
1178         private static final int CASED = 1 << 26;
1179     
1180         private static final int SCRIPT_PROPS[] = {
1181             // Begin copy-paste output from
1182             // tools/trunk/unicode/py/parsescriptmetadata.py
1183             // or from icu/trunk/source/common/uscript_props.cpp
1184             0x0040 | UNKNOWN,  // Zyyy
1185             0x0308 | UNKNOWN,  // Zinh
1186             0x0628 | RECOMMENDED | RTL,  // Arab
1187             0x0531 | RECOMMENDED | CASED,  // Armn
1188             0x0995 | RECOMMENDED,  // Beng
1189             0x3105 | RECOMMENDED | LB_LETTERS,  // Bopo
1190             0x13C4 | LIMITED_USE,  // Cher
1191             0x03E2 | EXCLUSION | CASED,  // Copt
1192             0x042F | RECOMMENDED | CASED,  // Cyrl
1193             0x10414 | EXCLUSION | CASED,  // Dsrt
1194             0x0905 | RECOMMENDED,  // Deva
1195             0x12A0 | RECOMMENDED,  // Ethi
1196             0x10D3 | RECOMMENDED,  // Geor
1197             0x10330 | EXCLUSION,  // Goth
1198             0x03A9 | RECOMMENDED | CASED,  // Grek
1199             0x0A95 | RECOMMENDED,  // Gujr
1200             0x0A15 | RECOMMENDED,  // Guru
1201             0x5B57 | RECOMMENDED | LB_LETTERS,  // Hani
1202             0xAC00 | RECOMMENDED,  // Hang
1203             0x05D0 | RECOMMENDED | RTL,  // Hebr
1204             0x304B | RECOMMENDED | LB_LETTERS,  // Hira
1205             0x0C95 | RECOMMENDED,  // Knda
1206             0x30AB | RECOMMENDED | LB_LETTERS,  // Kana
1207             0x1780 | RECOMMENDED | LB_LETTERS,  // Khmr
1208             0x0EA5 | RECOMMENDED | LB_LETTERS,  // Laoo
1209             0x004C | RECOMMENDED | CASED,  // Latn
1210             0x0D15 | RECOMMENDED,  // Mlym
1211             0x1826 | ASPIRATIONAL,  // Mong
1212             0x1000 | RECOMMENDED | LB_LETTERS,  // Mymr
1213             0x168F | EXCLUSION,  // Ogam
1214             0x10300 | EXCLUSION,  // Ital
1215             0x0B15 | RECOMMENDED,  // Orya
1216             0x16A0 | EXCLUSION,  // Runr
1217             0x0D85 | RECOMMENDED,  // Sinh
1218             0x0710 | LIMITED_USE | RTL,  // Syrc
1219             0x0B95 | RECOMMENDED,  // Taml
1220             0x0C15 | RECOMMENDED,  // Telu
1221             0x078C | RECOMMENDED | RTL,  // Thaa
1222             0x0E17 | RECOMMENDED | LB_LETTERS,  // Thai
1223             0x0F40 | RECOMMENDED,  // Tibt
1224             0x14C0 | ASPIRATIONAL,  // Cans
1225             0xA288 | ASPIRATIONAL | LB_LETTERS,  // Yiii
1226             0x1703 | EXCLUSION,  // Tglg
1227             0x1723 | EXCLUSION,  // Hano
1228             0x1743 | EXCLUSION,  // Buhd
1229             0x1763 | EXCLUSION,  // Tagb
1230             0x2800 | UNKNOWN,  // Brai
1231             0x10800 | EXCLUSION | RTL,  // Cprt
1232             0x1900 | LIMITED_USE,  // Limb
1233             0x10000 | EXCLUSION,  // Linb
1234             0x10480 | EXCLUSION,  // Osma
1235             0x10450 | EXCLUSION,  // Shaw
1236             0x1950 | LIMITED_USE | LB_LETTERS,  // Tale
1237             0x10380 | EXCLUSION,  // Ugar
1238             0,
1239             0x1A00 | EXCLUSION,  // Bugi
1240             0x2C00 | EXCLUSION | CASED,  // Glag
1241             0x10A00 | EXCLUSION | RTL,  // Khar
1242             0xA800 | LIMITED_USE,  // Sylo
1243             0x1980 | LIMITED_USE | LB_LETTERS,  // Talu
1244             0x2D30 | ASPIRATIONAL,  // Tfng
1245             0x103A0 | EXCLUSION,  // Xpeo
1246             0x1B05 | LIMITED_USE | LB_LETTERS,  // Bali
1247             0x1BC0 | LIMITED_USE,  // Batk
1248             0,
1249             0x11005 | EXCLUSION,  // Brah
1250             0xAA00 | LIMITED_USE,  // Cham
1251             0,
1252             0,
1253             0,
1254             0,
1255             0x13153 | EXCLUSION,  // Egyp
1256             0,
1257             0x5B57 | RECOMMENDED | LB_LETTERS,  // Hans
1258             0x5B57 | RECOMMENDED | LB_LETTERS,  // Hant
1259             0,
1260             0,
1261             0,
1262             0xA984 | LIMITED_USE | LB_LETTERS,  // Java
1263             0xA90A | LIMITED_USE,  // Kali
1264             0,
1265             0,
1266             0x1C00 | LIMITED_USE,  // Lepc
1267             0,
1268             0x0840 | LIMITED_USE | RTL,  // Mand
1269             0,
1270             0x10980 | EXCLUSION | RTL,  // Mero
1271             0x07CA | LIMITED_USE | RTL,  // Nkoo
1272             0x10C00 | EXCLUSION | RTL,  // Orkh
1273             0,
1274             0xA840 | EXCLUSION,  // Phag
1275             0x10900 | EXCLUSION | RTL,  // Phnx
1276             0x16F00 | ASPIRATIONAL,  // Plrd
1277             0,
1278             0,
1279             0,
1280             0,
1281             0,
1282             0,
1283             0xA549 | LIMITED_USE,  // Vaii
1284             0,
1285             0x12000 | EXCLUSION,  // Xsux
1286             0,
1287             0xFDD0 | UNKNOWN,  // Zzzz
1288             0x102A0 | EXCLUSION,  // Cari
1289             0x304B | RECOMMENDED | LB_LETTERS,  // Jpan
1290             0x1A20 | LIMITED_USE | LB_LETTERS,  // Lana
1291             0x10280 | EXCLUSION,  // Lyci
1292             0x10920 | EXCLUSION | RTL,  // Lydi
1293             0x1C5A | LIMITED_USE,  // Olck
1294             0xA930 | EXCLUSION,  // Rjng
1295             0xA882 | LIMITED_USE,  // Saur
1296             0,
1297             0x1B83 | LIMITED_USE,  // Sund
1298             0,
1299             0xABC0 | LIMITED_USE,  // Mtei
1300             0x10840 | EXCLUSION | RTL,  // Armi
1301             0x10B00 | EXCLUSION | RTL,  // Avst
1302             0x11103 | LIMITED_USE,  // Cakm
1303             0xAC00 | RECOMMENDED,  // Kore
1304             0x11083 | EXCLUSION,  // Kthi
1305             0,
1306             0x10B60 | EXCLUSION | RTL,  // Phli
1307             0,
1308             0,
1309             0x10B40 | EXCLUSION | RTL,  // Prti
1310             0x0800 | EXCLUSION | RTL,  // Samr
1311             0xAA80 | LIMITED_USE | LB_LETTERS,  // Tavt
1312             0,
1313             0,
1314             0xA6A0 | LIMITED_USE,  // Bamu
1315             0xA4D0 | LIMITED_USE,  // Lisu
1316             0,
1317             0x10A60 | EXCLUSION | RTL,  // Sarb
1318             0,
1319             0,
1320             0,
1321             0,
1322             0,
1323             0,
1324             0,
1325             0x109A0 | EXCLUSION | RTL,  // Merc
1326             0,
1327             0,
1328             0,
1329             0,
1330             0,
1331             0,
1332             0,
1333             0,
1334             0,
1335             0x11183 | EXCLUSION,  // Shrd
1336             0x110D0 | EXCLUSION,  // Sora
1337             0x11680 | EXCLUSION,  // Takr
1338             0,
1339             0,
1340             0,
1341             0,
1342             0,
1343             0,
1344             0,
1345             // End copy-paste from parsescriptmetadata.py
1346         };
1347
1348         private static final int getScriptProps(int script) {
1349             if (0 <= script && script < SCRIPT_PROPS.length) {
1350                 return SCRIPT_PROPS[script];
1351             } else {
1352                 return 0;
1353             }
1354         }
1355     }
1356
1357     /**
1358      * Script usage constants.
1359      * See UAX #31 Unicode Identifier and Pattern Syntax.
1360      * http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Exclusion_from_Identifiers
1361      *
1362      * @draft ICU 51
1363      * @provisional This API might change or be removed in a future release.
1364      */
1365     public enum ScriptUsage {
1366         /**
1367          * Not encoded in Unicode.
1368          * @draft ICU 51
1369          * @provisional This API might change or be removed in a future release.
1370          */
1371         NOT_ENCODED,
1372         /**
1373          * Unknown script usage.
1374          * @draft ICU 51
1375          * @provisional This API might change or be removed in a future release.
1376          */
1377         UNKNOWN,
1378         /**
1379          * Candidate for Exclusion from Identifiers.
1380          * @draft ICU 51
1381          * @provisional This API might change or be removed in a future release.
1382          */
1383         EXCLUDED,
1384         /**
1385          * Limited Use script.
1386          * @draft ICU 51
1387          * @provisional This API might change or be removed in a future release.
1388          */
1389         LIMITED_USE,
1390         /**
1391          * Aspirational Use script.
1392          * @draft ICU 51
1393          * @provisional This API might change or be removed in a future release.
1394          */
1395         ASPIRATIONAL,
1396         /**
1397          * Recommended script.
1398          * @draft ICU 51
1399          * @provisional This API might change or be removed in a future release.
1400          */
1401         RECOMMENDED
1402     }
1403     private static final ScriptUsage[] usageValues = ScriptUsage.values();
1404
1405     /**
1406      * Returns the script sample character string.
1407      * This string normally consists of one code point but might be longer.
1408      * The string is empty if the script is not encoded.
1409      *
1410      * @param script script code
1411      * @return the sample character string
1412      * @draft ICU 51
1413      * @provisional This API might change or be removed in a future release.
1414      */
1415     public static final String getSampleString(int script) {
1416         int sampleChar = ScriptMetadata.getScriptProps(script) & 0x1fffff;
1417         if(sampleChar != 0) {
1418             return new StringBuilder().appendCodePoint(sampleChar).toString();
1419         }
1420         return "";
1421     }
1422
1423     /**
1424      * Returns the script usage according to UAX #31 Unicode Identifier and Pattern Syntax.
1425      * Returns {@link ScriptUsage#NOT_ENCODED} if the script is not encoded in Unicode.
1426      *
1427      * @param script script code
1428      * @return script usage
1429      * @see ScriptUsage
1430      * @draft ICU 51
1431      * @provisional This API might change or be removed in a future release.
1432      */
1433     public static final ScriptUsage getUsage(int script) {
1434         return usageValues[(ScriptMetadata.getScriptProps(script) >> 21) & 7];
1435     }
1436
1437     /**
1438      * Returns true if the script is written right-to-left.
1439      * For example, Arab and Hebr.
1440      *
1441      * @param script script code
1442      * @return true if the script is right-to-left
1443      * @draft ICU 51
1444      * @provisional This API might change or be removed in a future release.
1445      */
1446     public static final boolean isRightToLeft(int script) {
1447         return (ScriptMetadata.getScriptProps(script) & ScriptMetadata.RTL) != 0;
1448     }
1449
1450     /**
1451      * Returns true if the script allows line breaks between letters (excluding hyphenation).
1452      * Such a script typically requires dictionary-based line breaking.
1453      * For example, Hani and Thai.
1454      *
1455      * @param script script code
1456      * @return true if the script allows line breaks between letters
1457      * @draft ICU 51
1458      * @provisional This API might change or be removed in a future release.
1459      */
1460     public static final boolean breaksBetweenLetters(int script) {
1461         return (ScriptMetadata.getScriptProps(script) & ScriptMetadata.LB_LETTERS) != 0;
1462     }
1463
1464     /**
1465      * Returns true if in modern (or most recent) usage of the script case distinctions are customary.
1466      * For example, Latn and Cyrl.
1467      *
1468      * @param script script code
1469      * @return true if the script is cased
1470      * @draft ICU 51
1471      * @provisional This API might change or be removed in a future release.
1472      */
1473     public static final boolean isCased(int script) {
1474         return (ScriptMetadata.getScriptProps(script) & ScriptMetadata.CASED) != 0;
1475     }
1476
1477     ///CLOVER:OFF
1478     /**
1479      *  Private Constructor. Never default construct
1480      */
1481     private UScript(){}
1482     ///CLOVER:ON
1483 }