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