1/*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.  Oracle designates this
7 * particular file as subject to the "Classpath" exception as provided
8 * by Oracle in the LICENSE file that accompanied this code.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24/*
25/**
26 *******************************************************************************
27 * Copyright (C) 2004, International Business Machines Corporation and         *
28 * others. All Rights Reserved.                                                *
29 *******************************************************************************
30 */
31// CHANGELOG
32//      2005-05-19 Edward Wang
33//          - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterEnums.java
34//          - move from package com.ibm.icu.lang to package sun.net.idn
35//
36//      2011-09-06 Kurchi Subhra Hazra
37//          - Added @Deprecated tag to the following:
38//            - class UCharacterEnums
39//            - interfaces ECharacterCategory, ECharacterDirection
40//            - fields INITIAL_QUOTE_PUNCTUATION, FINAL_QUOTE_PUNCTUATION,
41//              DIRECTIONALITY_LEFT_TO_RIGHT, DIRECTIONALITY_RIGHT_TO_LEFT,
42//              DIRECTIONALITY_EUROPEAN_NUMBER, DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
43//              DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, DIRECTIONALITY_ARABIC_NUMBER,
44//              DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, DIRECTIONALITY_PARAGRAPH_SEPARATOR,
45//              DIRECTIONALITY_SEGMENT_SEPARATOR, DIRECTIONALITY_WHITESPACE,
46//              DIRECTIONALITY_OTHER_NEUTRALS, DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING,
47//              DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC,
48//              DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE,
49//              DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, DIRECTIONALITY_NON_SPACING_MARK,
50//              DIRECTIONALITY_BOUNDARY_NEUTRAL, DIRECTIONALITY_UNDEFINED
51//
52
53package sun.net.idn;
54
55/**
56 * A container for the different 'enumerated types' used by UCharacter.
57 * @draft ICU 3.0
58 * @deprecated This is a draft API and might change in a future release of ICU.
59 */
60
61@Deprecated
62class UCharacterEnums {
63
64    /** This is just a namespace, it is not instantiatable. */
65    private UCharacterEnums() {};
66
67    /**
68     * 'Enum' for the CharacterCategory constants.  These constants are
69     * compatible in name <b>but not in value</b> with those defined in
70     * <code>java.lang.Character</code>.
71     * @see UCharacterCategory
72     * @draft ICU 3.0
73     * @deprecated This is a draft API and might change in a future release of ICU.
74     */
75    @Deprecated
76    public static interface ECharacterCategory {
77        /**
78         * Unassigned character type
79         * @stable ICU 2.1
80         */
81        public static final int UNASSIGNED              = 0;
82
83        /**
84         * Character type Cn
85         * Not Assigned (no characters in [UnicodeData.txt] have this property)
86         * @stable ICU 2.6
87         */
88        public static final int GENERAL_OTHER_TYPES     = 0;
89
90        /**
91         * Character type Lu
92         * @stable ICU 2.1
93         */
94        public static final int UPPERCASE_LETTER        = 1;
95
96        /**
97         * Character type Ll
98         * @stable ICU 2.1
99         */
100        public static final int LOWERCASE_LETTER        = 2;
101
102        /**
103         * Character type Lt
104         * @stable ICU 2.1
105         */
106
107        public static final int TITLECASE_LETTER        = 3;
108
109        /**
110         * Character type Lm
111         * @stable ICU 2.1
112         */
113        public static final int MODIFIER_LETTER         = 4;
114
115        /**
116         * Character type Lo
117         * @stable ICU 2.1
118         */
119        public static final int OTHER_LETTER            = 5;
120
121        /**
122         * Character type Mn
123         * @stable ICU 2.1
124         */
125        public static final int NON_SPACING_MARK        = 6;
126
127        /**
128         * Character type Me
129         * @stable ICU 2.1
130         */
131        public static final int ENCLOSING_MARK          = 7;
132
133        /**
134         * Character type Mc
135         * @stable ICU 2.1
136         */
137        public static final int COMBINING_SPACING_MARK  = 8;
138
139        /**
140         * Character type Nd
141         * @stable ICU 2.1
142         */
143        public static final int DECIMAL_DIGIT_NUMBER    = 9;
144
145        /**
146         * Character type Nl
147         * @stable ICU 2.1
148         */
149        public static final int LETTER_NUMBER           = 10;
150
151        /**
152         * Character type No
153         * @stable ICU 2.1
154         */
155        public static final int OTHER_NUMBER            = 11;
156
157        /**
158         * Character type Zs
159         * @stable ICU 2.1
160         */
161        public static final int SPACE_SEPARATOR         = 12;
162
163        /**
164         * Character type Zl
165         * @stable ICU 2.1
166         */
167        public static final int LINE_SEPARATOR          = 13;
168
169        /**
170         * Character type Zp
171         * @stable ICU 2.1
172         */
173        public static final int PARAGRAPH_SEPARATOR     = 14;
174
175        /**
176         * Character type Cc
177         * @stable ICU 2.1
178         */
179        public static final int CONTROL                 = 15;
180
181        /**
182         * Character type Cf
183         * @stable ICU 2.1
184         */
185        public static final int FORMAT                  = 16;
186
187        /**
188         * Character type Co
189         * @stable ICU 2.1
190         */
191        public static final int PRIVATE_USE             = 17;
192
193        /**
194         * Character type Cs
195         * @stable ICU 2.1
196         */
197        public static final int SURROGATE               = 18;
198
199        /**
200         * Character type Pd
201         * @stable ICU 2.1
202         */
203        public static final int DASH_PUNCTUATION        = 19;
204
205        /**
206         * Character type Ps
207         * @stable ICU 2.1
208         */
209        public static final int START_PUNCTUATION       = 20;
210
211        /**
212         * Character type Pe
213         * @stable ICU 2.1
214         */
215        public static final int END_PUNCTUATION         = 21;
216
217        /**
218         * Character type Pc
219         * @stable ICU 2.1
220         */
221        public static final int CONNECTOR_PUNCTUATION   = 22;
222
223        /**
224         * Character type Po
225         * @stable ICU 2.1
226         */
227        public static final int OTHER_PUNCTUATION       = 23;
228
229        /**
230         * Character type Sm
231         * @stable ICU 2.1
232         */
233        public static final int MATH_SYMBOL             = 24;
234
235        /**
236         * Character type Sc
237         * @stable ICU 2.1
238         */
239        public static final int CURRENCY_SYMBOL         = 25;
240
241        /**
242         * Character type Sk
243         * @stable ICU 2.1
244         */
245        public static final int MODIFIER_SYMBOL         = 26;
246
247        /**
248         * Character type So
249         * @stable ICU 2.1
250         */
251        public static final int OTHER_SYMBOL            = 27;
252
253        /**
254         * Character type Pi
255         * @see #INITIAL_QUOTE_PUNCTUATION
256         * @stable ICU 2.1
257         */
258        public static final int INITIAL_PUNCTUATION     = 28;
259
260        /**
261         * Character type Pi
262         * This name is compatible with java.lang.Character's name for this type.
263         * @see #INITIAL_PUNCTUATION
264         * @draft ICU 2.8
265     * @deprecated This is a draft API and might change in a future release of ICU.
266         */
267        @Deprecated
268        public static final int INITIAL_QUOTE_PUNCTUATION = 28;
269
270        /**
271         * Character type Pf
272         * @see #FINAL_QUOTE_PUNCTUATION
273         * @stable ICU 2.1
274         */
275        public static final int FINAL_PUNCTUATION       = 29;
276
277        /**
278         * Character type Pf
279         * This name is compatible with java.lang.Character's name for this type.
280         * @see #FINAL_PUNCTUATION
281         * @draft ICU 2.8
282     * @deprecated This is a draft API and might change in a future release of ICU.
283         */
284        @Deprecated
285        public static final int FINAL_QUOTE_PUNCTUATION   = 29;
286
287        /**
288         * Character type count
289         * @stable ICU 2.1
290         */
291        public static final int CHAR_CATEGORY_COUNT     = 30;
292    }
293
294    /**
295     * 'Enum' for the CharacterDirection constants.  There are two sets
296     * of names, those used in ICU, and those used in the JDK.  The
297     * JDK constants are compatible in name <b>but not in value</b>
298     * with those defined in <code>java.lang.Character</code>.
299     * @see UCharacterDirection
300     * @draft ICU 3.0
301     * @deprecated This is a draft API and might change in a future release of ICU.
302     */
303
304    @Deprecated
305    public static interface ECharacterDirection {
306        /**
307         * Directional type L
308         * @stable ICU 2.1
309         */
310        public static final int LEFT_TO_RIGHT              = 0;
311
312        /**
313         * JDK-compatible synonum for LEFT_TO_RIGHT.
314         * @draft ICU 3.0
315     * @deprecated This is a draft API and might change in a future release of ICU.
316         */
317        @Deprecated
318        public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = (byte)LEFT_TO_RIGHT;
319
320        /**
321         * Directional type R
322         * @stable ICU 2.1
323         */
324        public static final int RIGHT_TO_LEFT              = 1;
325
326        /**
327         * JDK-compatible synonum for RIGHT_TO_LEFT.
328         * @draft ICU 3.0
329     * @deprecated This is a draft API and might change in a future release of ICU.
330         */
331        @Deprecated
332        public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = (byte)RIGHT_TO_LEFT;
333
334        /**
335         * Directional type EN
336         * @stable ICU 2.1
337         */
338        public static final int EUROPEAN_NUMBER            = 2;
339
340        /**
341         * JDK-compatible synonum for EUROPEAN_NUMBER.
342         * @draft ICU 3.0
343     * @deprecated This is a draft API and might change in a future release of ICU.
344         */
345        @Deprecated
346        public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = (byte)EUROPEAN_NUMBER;
347
348        /**
349         * Directional type ES
350         * @stable ICU 2.1
351         */
352        public static final int EUROPEAN_NUMBER_SEPARATOR  = 3;
353
354        /**
355         * JDK-compatible synonum for EUROPEAN_NUMBER_SEPARATOR.
356         * @draft ICU 3.0
357     * @deprecated This is a draft API and might change in a future release of ICU.
358         */
359        @Deprecated
360        public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = (byte)EUROPEAN_NUMBER_SEPARATOR;
361
362        /**
363         * Directional type ET
364         * @stable ICU 2.1
365         */
366        public static final int EUROPEAN_NUMBER_TERMINATOR = 4;
367
368        /**
369         * JDK-compatible synonum for EUROPEAN_NUMBER_TERMINATOR.
370         * @draft ICU 3.0
371     * @deprecated This is a draft API and might change in a future release of ICU.
372         */
373        @Deprecated
374        public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = (byte)EUROPEAN_NUMBER_TERMINATOR;
375
376        /**
377         * Directional type AN
378         * @stable ICU 2.1
379         */
380        public static final int ARABIC_NUMBER              = 5;
381
382        /**
383         * JDK-compatible synonum for ARABIC_NUMBER.
384         * @draft ICU 3.0
385     * @deprecated This is a draft API and might change in a future release of ICU.
386         */
387        @Deprecated
388        public static final byte DIRECTIONALITY_ARABIC_NUMBER = (byte)ARABIC_NUMBER;
389
390        /**
391         * Directional type CS
392         * @stable ICU 2.1
393         */
394        public static final int COMMON_NUMBER_SEPARATOR    = 6;
395
396        /**
397         * JDK-compatible synonum for COMMON_NUMBER_SEPARATOR.
398         * @draft ICU 3.0
399     * @deprecated This is a draft API and might change in a future release of ICU.
400         */
401        @Deprecated
402        public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = (byte)COMMON_NUMBER_SEPARATOR;
403
404        /**
405         * Directional type B
406         * @stable ICU 2.1
407         */
408        public static final int BLOCK_SEPARATOR            = 7;
409
410        /**
411         * JDK-compatible synonum for BLOCK_SEPARATOR.
412         * @draft ICU 3.0
413     * @deprecated This is a draft API and might change in a future release of ICU.
414         */
415        @Deprecated
416        public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = (byte)BLOCK_SEPARATOR;
417
418        /**
419         * Directional type S
420         * @stable ICU 2.1
421         */
422        public static final int SEGMENT_SEPARATOR          = 8;
423
424        /**
425         * JDK-compatible synonum for SEGMENT_SEPARATOR.
426         * @draft ICU 3.0
427     * @deprecated This is a draft API and might change in a future release of ICU.
428         */
429        @Deprecated
430        public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = (byte)SEGMENT_SEPARATOR;
431
432        /**
433         * Directional type WS
434         * @stable ICU 2.1
435         */
436        public static final int WHITE_SPACE_NEUTRAL        = 9;
437
438        /**
439         * JDK-compatible synonum for WHITE_SPACE_NEUTRAL.
440         * @draft ICU 3.0
441     * @deprecated This is a draft API and might change in a future release of ICU.
442         */
443        @Deprecated
444        public static final byte DIRECTIONALITY_WHITESPACE = (byte)WHITE_SPACE_NEUTRAL;
445
446        /**
447         * Directional type ON
448         * @stable ICU 2.1
449         */
450        public static final int OTHER_NEUTRAL              = 10;
451
452        /**
453         * JDK-compatible synonum for OTHER_NEUTRAL.
454         * @draft ICU 3.0
455     * @deprecated This is a draft API and might change in a future release of ICU.
456         */
457        @Deprecated
458        public static final byte DIRECTIONALITY_OTHER_NEUTRALS = (byte)OTHER_NEUTRAL;
459
460        /**
461         * Directional type LRE
462         * @stable ICU 2.1
463         */
464        public static final int LEFT_TO_RIGHT_EMBEDDING    = 11;
465
466        /**
467         * JDK-compatible synonum for LEFT_TO_RIGHT_EMBEDDING.
468         * @draft ICU 3.0
469     * @deprecated This is a draft API and might change in a future release of ICU.
470         */
471        @Deprecated
472        public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = (byte)LEFT_TO_RIGHT_EMBEDDING;
473
474        /**
475         * Directional type LRO
476         * @stable ICU 2.1
477         */
478        public static final int LEFT_TO_RIGHT_OVERRIDE     = 12;
479
480        /**
481         * JDK-compatible synonum for LEFT_TO_RIGHT_OVERRIDE.
482         * @draft ICU 3.0
483     * @deprecated This is a draft API and might change in a future release of ICU.
484         */
485        @Deprecated
486        public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = (byte)LEFT_TO_RIGHT_OVERRIDE;
487
488        /**
489         * Directional type AL
490         * @stable ICU 2.1
491         */
492        public static final int RIGHT_TO_LEFT_ARABIC       = 13;
493
494        /**
495         * JDK-compatible synonum for RIGHT_TO_LEFT_ARABIC.
496         * @draft ICU 3.0
497     * @deprecated This is a draft API and might change in a future release of ICU.
498         */
499        @Deprecated
500        public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = (byte)RIGHT_TO_LEFT_ARABIC;
501
502        /**
503         * Directional type RLE
504         * @stable ICU 2.1
505         */
506        public static final int RIGHT_TO_LEFT_EMBEDDING    = 14;
507
508        /**
509         * JDK-compatible synonum for RIGHT_TO_LEFT_EMBEDDING.
510         * @draft ICU 3.0
511     * @deprecated This is a draft API and might change in a future release of ICU.
512         */
513        @Deprecated
514        public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = (byte)RIGHT_TO_LEFT_EMBEDDING;
515
516        /**
517         * Directional type RLO
518         * @stable ICU 2.1
519         */
520        public static final int RIGHT_TO_LEFT_OVERRIDE     = 15;
521
522        /**
523         * JDK-compatible synonum for RIGHT_TO_LEFT_OVERRIDE.
524         * @draft ICU 3.0
525     * @deprecated This is a draft API and might change in a future release of ICU.
526         */
527        @Deprecated
528        public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = (byte)RIGHT_TO_LEFT_OVERRIDE;
529
530        /**
531         * Directional type PDF
532         * @stable ICU 2.1
533         */
534        public static final int POP_DIRECTIONAL_FORMAT     = 16;
535
536        /**
537         * JDK-compatible synonum for POP_DIRECTIONAL_FORMAT.
538         * @draft ICU 3.0
539     * @deprecated This is a draft API and might change in a future release of ICU.
540         */
541        @Deprecated
542        public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = (byte)POP_DIRECTIONAL_FORMAT;
543
544        /**
545         * Directional type NSM
546         * @stable ICU 2.1
547         */
548        public static final int DIR_NON_SPACING_MARK       = 17;
549
550        /**
551         * JDK-compatible synonum for DIR_NON_SPACING_MARK.
552         * @draft ICU 3.0
553     * @deprecated This is a draft API and might change in a future release of ICU.
554         */
555        @Deprecated
556        public static final byte DIRECTIONALITY_NON_SPACING_MARK = (byte)DIR_NON_SPACING_MARK;
557
558        /**
559         * Directional type BN
560         * @stable ICU 2.1
561         */
562        public static final int BOUNDARY_NEUTRAL           = 18;
563
564        /**
565         * JDK-compatible synonum for BOUNDARY_NEUTRAL.
566         * @draft ICU 3.0
567     * @deprecated This is a draft API and might change in a future release of ICU.
568         */
569        @Deprecated
570        public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = (byte)BOUNDARY_NEUTRAL;
571
572        /**
573         * Number of directional types
574         * @stable ICU 2.1
575         */
576        public static final int CHAR_DIRECTION_COUNT       = 19;
577
578        /**
579         * Undefined bidirectional character type. Undefined <code>char</code>
580         * values have undefined directionality in the Unicode specification.
581     * @draft ICU 3.0
582     * @deprecated This is a draft API and might change in a future release of ICU.
583         */
584        @Deprecated
585        public static final byte DIRECTIONALITY_UNDEFINED = -1;
586    }
587}
588