When these objects are printed or displayed, they must be converted to localized strings. It can also tell if two strings match, for searching. The Collator class and its subclass RuleBasedCollator perform locale-sensitive string comparison. You use these classes to build searching and alphabetical sorting routines for natural language text. Collator is an abstract base class.
Subclasses implement specific collation strategies.
One subclass, RuleBasedCollator , is currently provided and is applicable to a wide set of languages. Other subclasses may be created to handle more specialized needs. CollationElementIterator provides an iterator for stepping through each character of a locale-specific string according to the rules of a specific Collator object. CollationKey enables fast sorting of strings by representing a string as a sort key under the rules of a specific Collator object. While the Java types char and Character represent Unicode characters, sometimes Unicode characters combine to form a more complex character that has its own semantic value, a user character .