@Deprecated public final class ComposedCharIter extends Object
ComposedCharIter is an iterator class that returns all of the precomposed characters defined in the Unicode standard, along with their decomposed forms. This is often useful when building data tables (e.g. collation tables) which need to treat composed and decomposed characters equivalently.
For example, imagine that you have built a collation table with ordering
rules for the canonically decomposed
forms of all
characters used in a particular language. When you process input text using
this table, the text must first be decomposed so that it matches the form
used in the table. This can impose a performance penalty that may be
unacceptable in some situations.
You can avoid this problem by ensuring that the collation table contains rules for both the decomposed and composed versions of each character. To do so, use a ComposedCharIter to iterate through all of the composed characters in Unicode. If the decomposition for that character consists solely of characters that are listed in your ruleset, you can add a new rule for the composed character that makes it equivalent to its decomposition sequence.
Note that ComposedCharIter iterates over a static table
of the composed characters in Unicode. If you want to iterate over the
composed characters in a particular string, use Normalizer
instead.
When constructing a ComposedCharIter there is one optional feature that you can enable or disable:
Normalizer.IGNORE_HANGUL
- Do not iterate over the Hangul
characters and their corresponding Jamo decompositions.
This option is off by default (i.e. Hangul processing is enabled)
since the Unicode standard specifies that Hangul to Jamo
is a canonical decomposition.
ComposedCharIter is currently based on version 2.1.8 of the Unicode Standard. It will be updated as later versions of Unicode are released.
Modifier and Type | Field and Description |
---|---|
static char |
DONE
Deprecated.
ICU 2.2
|
Constructor and Description |
---|
ComposedCharIter()
Deprecated.
ICU 2.2
|
ComposedCharIter(boolean compat,
int options)
Deprecated.
ICU 2.2
|
Modifier and Type | Method and Description |
---|---|
String |
decomposition()
Deprecated.
ICU 2.2
|
boolean |
hasNext()
Deprecated.
ICU 2.2
|
char |
next()
Deprecated.
ICU 2.2
|
@Deprecated public static final char DONE
next()
returns this value when there are no more composed characters
over which to iterate.@Deprecated public ComposedCharIter()
@Deprecated public ComposedCharIter(boolean compat, int options)
compat
- false for canonical decompositions only;
true for both canonical and compatibility
decompositions.options
- Optional decomposition features. None are supported, so this is ignored.@Deprecated public boolean hasNext()
next()
.@Deprecated public char next()
@Deprecated public String decomposition()
next()
. The resulting decomposition is
affected by the settings of the options passed to the constructor.Copyright © 2016 Unicode, Inc. and others.