| java.lang.Object | ||
| ↳ | java.text.Collator | |
| ↳ | java.text.RuleBasedCollator | |
RuleBasedCollator is a concrete subclass of
Collator. It allows customization of the
Collator via user-specified rule sets.
RuleBasedCollator is designed to be fully compliant to the Unicode Collation
Algorithm (UCA) and conforms to ISO 14651.
Create a RuleBasedCollator from a locale by calling the
getInstance(Locale) factory method in the base class
Collator.Collator.getInstance(Locale) creates
a RuleBasedCollator object based on the collation rules
defined by the argument locale. If a customized collation is required, use
the RuleBasedCollator(String) constructor with the appropriate
rules. The customized RuleBasedCollator will base its ordering
on UCA, while re-adjusting the attributes and orders of the characters in the
specified rule accordingly.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.text.Collator
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
RuleBasedCollator using the
specified rules. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Obtains the cloned object of the
RuleBasedCollator | |||||||||||
Compares the
source text String to the
target text String according to the
collation rules, strength and decomposition mode for this
RuleBasedCollator. | |||||||||||
Compares the equality of two
RuleBasedCollator objects. | |||||||||||
Obtains a
CollationElementIterator for the given
CharacterIterator. | |||||||||||
Obtains a
CollationElementIterator for the given String. | |||||||||||
Obtains the
CollationKey for the given source text. | |||||||||||
Obtains the collation rules of the
RuleBasedCollator. | |||||||||||
Obtains a unique hash code for the
RuleBasedCollator | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.text.Collator
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.util.Comparator
| |||||||||||
Constructs a new instance of RuleBasedCollator using the
specified rules.
| rules | the collation rules. |
|---|
| ParseException | when the rules contains an invalid collation rule syntax. |
|---|
Obtains the cloned object of the RuleBasedCollator
RuleBasedCollator
Compares the source text String to the
target text String according to the
collation rules, strength and decomposition mode for this
RuleBasedCollator. See the Collator class
description for an example of use.
General recommendation: If comparisons are to be done to the same String
multiple times, it would be more efficient to generate
CollationKeys for the String s and use
CollationKey.compareTo(CollationKey) for the comparisons.
If the each Strings are compared to only once, using the method
RuleBasedCollator.compare(String, String) will have a better performance.
| source | the source text |
|---|---|
| target | the target text |
source is less
than, equivalent to, or greater than target.
Compares the equality of two RuleBasedCollator objects.
RuleBasedCollator objects are equal if they have the same
collation rules and the same attributes.
| obj | the other object. |
|---|
true if this RuleBasedCollator has
exactly the same collation behaviour as obj, false
otherwise.
Obtains a CollationElementIterator for the given
CharacterIterator. The source iterator's integrity will
be preserved since a new copy will be created for use.
| source | the specified source |
|---|
CollationElementIterator for the source.
Obtains a CollationElementIterator for the given String.
| source | the specified source |
|---|
CollationElementIterator for the given String
Obtains the CollationKey for the given source text.
| source | the specified source text |
|---|
CollationKey for the given source text.
Obtains the collation rules of the RuleBasedCollator.
Obtains a unique hash code for the RuleBasedCollator
RuleBasedCollator