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