109 { |
109 { |
110 /** |
110 /** |
111 * Null order which indicates the end of string is reached by the |
111 * Null order which indicates the end of string is reached by the |
112 * cursor. |
112 * cursor. |
113 */ |
113 */ |
114 public final static int NULLORDER = 0xffffffff; |
114 public static final int NULLORDER = 0xffffffff; |
115 |
115 |
116 /** |
116 /** |
117 * CollationElementIterator constructor. This takes the source string and |
117 * CollationElementIterator constructor. This takes the source string and |
118 * the collation object. The cursor will walk thru the source string based |
118 * the collation object. The cursor will walk thru the source string based |
119 * on the predefined collation rules. If the source string is empty, |
119 * on the predefined collation rules. If the source string is empty, |
356 /** |
356 /** |
357 * Return the primary component of a collation element. |
357 * Return the primary component of a collation element. |
358 * @param order the collation element |
358 * @param order the collation element |
359 * @return the element's primary component |
359 * @return the element's primary component |
360 */ |
360 */ |
361 public final static int primaryOrder(int order) |
361 public static final int primaryOrder(int order) |
362 { |
362 { |
363 order &= RBCollationTables.PRIMARYORDERMASK; |
363 order &= RBCollationTables.PRIMARYORDERMASK; |
364 return (order >>> RBCollationTables.PRIMARYORDERSHIFT); |
364 return (order >>> RBCollationTables.PRIMARYORDERSHIFT); |
365 } |
365 } |
366 /** |
366 /** |
367 * Return the secondary component of a collation element. |
367 * Return the secondary component of a collation element. |
368 * @param order the collation element |
368 * @param order the collation element |
369 * @return the element's secondary component |
369 * @return the element's secondary component |
370 */ |
370 */ |
371 public final static short secondaryOrder(int order) |
371 public static final short secondaryOrder(int order) |
372 { |
372 { |
373 order = order & RBCollationTables.SECONDARYORDERMASK; |
373 order = order & RBCollationTables.SECONDARYORDERMASK; |
374 return ((short)(order >> RBCollationTables.SECONDARYORDERSHIFT)); |
374 return ((short)(order >> RBCollationTables.SECONDARYORDERSHIFT)); |
375 } |
375 } |
376 /** |
376 /** |
377 * Return the tertiary component of a collation element. |
377 * Return the tertiary component of a collation element. |
378 * @param order the collation element |
378 * @param order the collation element |
379 * @return the element's tertiary component |
379 * @return the element's tertiary component |
380 */ |
380 */ |
381 public final static short tertiaryOrder(int order) |
381 public static final short tertiaryOrder(int order) |
382 { |
382 { |
383 return ((short)(order &= RBCollationTables.TERTIARYORDERMASK)); |
383 return ((short)(order &= RBCollationTables.TERTIARYORDERMASK)); |
384 } |
384 } |
385 |
385 |
386 /** |
386 /** |
538 |
538 |
539 /** |
539 /** |
540 * Determine if a character is a Thai vowel (which sorts after |
540 * Determine if a character is a Thai vowel (which sorts after |
541 * its base consonant). |
541 * its base consonant). |
542 */ |
542 */ |
543 private final static boolean isThaiPreVowel(int ch) { |
543 private static final boolean isThaiPreVowel(int ch) { |
544 return (ch >= 0x0e40) && (ch <= 0x0e44); |
544 return (ch >= 0x0e40) && (ch <= 0x0e44); |
545 } |
545 } |
546 |
546 |
547 /** |
547 /** |
548 * Determine if a character is a Thai base consonant |
548 * Determine if a character is a Thai base consonant |
549 */ |
549 */ |
550 private final static boolean isThaiBaseConsonant(int ch) { |
550 private static final boolean isThaiBaseConsonant(int ch) { |
551 return (ch >= 0x0e01) && (ch <= 0x0e2e); |
551 return (ch >= 0x0e01) && (ch <= 0x0e2e); |
552 } |
552 } |
553 |
553 |
554 /** |
554 /** |
555 * Determine if a character is a Lao vowel (which sorts after |
555 * Determine if a character is a Lao vowel (which sorts after |
556 * its base consonant). |
556 * its base consonant). |
557 */ |
557 */ |
558 private final static boolean isLaoPreVowel(int ch) { |
558 private static final boolean isLaoPreVowel(int ch) { |
559 return (ch >= 0x0ec0) && (ch <= 0x0ec4); |
559 return (ch >= 0x0ec0) && (ch <= 0x0ec4); |
560 } |
560 } |
561 |
561 |
562 /** |
562 /** |
563 * Determine if a character is a Lao base consonant |
563 * Determine if a character is a Lao base consonant |
564 */ |
564 */ |
565 private final static boolean isLaoBaseConsonant(int ch) { |
565 private static final boolean isLaoBaseConsonant(int ch) { |
566 return (ch >= 0x0e81) && (ch <= 0x0eae); |
566 return (ch >= 0x0e81) && (ch <= 0x0eae); |
567 } |
567 } |
568 |
568 |
569 /** |
569 /** |
570 * This method produces a buffer which contains the collation |
570 * This method produces a buffer which contains the collation |
768 maxLength -= Character.charCount(c); |
768 maxLength -= Character.charCount(c); |
769 } |
769 } |
770 return order; |
770 return order; |
771 } |
771 } |
772 |
772 |
773 final static int UNMAPPEDCHARVALUE = 0x7FFF0000; |
773 static final int UNMAPPEDCHARVALUE = 0x7FFF0000; |
774 |
774 |
775 private NormalizerBase text = null; |
775 private NormalizerBase text = null; |
776 private int[] buffer = null; |
776 private int[] buffer = null; |
777 private int expIndex = 0; |
777 private int expIndex = 0; |
778 private StringBuffer key = new StringBuffer(5); |
778 private StringBuffer key = new StringBuffer(5); |