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