Top Description Fields Constructors Methods
com.ibm.icu.text

public final Class ComposedCharIter

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
com.ibm.icu.impl.Norm2AllModes, .Normalizer2Impl

Deprecated

ICU 2.2

This class has been deprecated since ICU 2.2. One problem is that this class is not designed to return supplementary characters. Use the Normalizer2 and UCharacter classes instead.

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:

ComposedCharIter is currently based on version 2.1.8 of the Unicode Standard. It will be updated as later versions of Unicode are released.

Field Summary

Modifier and TypeField and Description
private int
private String
public static final char
DONE

Constant that indicates the iteration has completed.

private final Normalizer2Impl
private int

Constructor Summary

AccessConstructor and Description
public
ComposedCharIter()

Deprecated ICU 2.2
Construct a new ComposedCharIter.
public
ComposedCharIter(boolean
false for canonical decompositions only; true for both canonical and compatibility decompositions.
compat
,
int
Optional decomposition features. None are supported, so this is ignored.
options
)

Deprecated ICU 2.2
Constructs a non-default ComposedCharIter with optional behavior.

Method Summary

Modifier and TypeMethod and Description
public String
decomposition()

Deprecated ICU 2.2
Returns the Unicode decomposition of the current character.
private void
public boolean
hasNext()

Deprecated ICU 2.2
Determines whether there any precomposed Unicode characters not yet returned by next.
public char
next()

Deprecated ICU 2.2
Returns the next precomposed Unicode character.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

curCharback to summary
private int curChar
decompBufback to summary
private String decompBuf
DONEback to summary
public static final char DONE

Deprecated

ICU 2.2

Constant that indicates the iteration has completed. next returns this value when there are no more composed characters over which to iterate.

Annotations
@Deprecated
n2implback to summary
private final Normalizer2Impl n2impl
nextCharback to summary
private int nextChar

Constructor Detail

ComposedCharIterback to summary
public ComposedCharIter()

Deprecated

ICU 2.2

Construct a new ComposedCharIter. The iterator will return all Unicode characters with canonical decompositions, including Korean Hangul characters.

Annotations
@Deprecated
ComposedCharIterback to summary
public ComposedCharIter(boolean compat, int options)

Deprecated

ICU 2.2

Constructs a non-default ComposedCharIter with optional behavior.

Parameters
compat:boolean

false for canonical decompositions only; true for both canonical and compatibility decompositions.

options:int

Optional decomposition features. None are supported, so this is ignored.

Annotations
@Deprecated

Method Detail

decompositionback to summary
public String decomposition()

Deprecated

ICU 2.2

Returns the Unicode decomposition of the current character. This method returns the decomposition of the precomposed character most recently returned by next. The resulting decomposition is affected by the settings of the options passed to the constructor.

Annotations
@Deprecated
findNextCharback to summary
private void findNextChar()
hasNextback to summary
public boolean hasNext()

Deprecated

ICU 2.2

Determines whether there any precomposed Unicode characters not yet returned by next.

Annotations
@Deprecated
nextback to summary
public char next()

Deprecated

ICU 2.2

Returns the next precomposed Unicode character. Repeated calls to next return all of the precomposed characters defined by Unicode, in ascending order. After all precomposed characters have been returned, hasNext will return false and further calls to next will return DONE.

Annotations
@Deprecated