Collator public class Collator extends Object implements Cloneable , Serializable The Collator class performs locale-sensitive String comparison. You use this class to build searching and sorting routines for natural language text. Collator is an abstract base class.
Subclasses implement specific collation strategies.
One subclass, RuleBasedCollator , is currently provided with the JDK and is applicable to a wide set of languages. Other subclasses may be created to handle more specialized needs. Like other locale-sensitive classes, you can use the static factory method, getInstance , to obtain the appropriate Collator object for a given locale. You will only need to look at the subclasses of Collator if you need to understand the details of a particular collation strategy or if you need to modify that strategy. The following example shows how to compare two strings using the Collator for the default locale.