#include <tblcoll.h>
Inheritance diagram for RuleBasedCollator:
Public Methods | |
RuleBasedCollator (const UnicodeString &rules, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
RuleBasedCollator (const UnicodeString &rules, UColAttributeValue decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, UColAttributeValue decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
RuleBasedCollator (const RuleBasedCollator &other) | |
Copy constructor. More... | |
virtual | ~RuleBasedCollator () |
Destructor. More... | |
RuleBasedCollator & | operator= (const RuleBasedCollator &other) |
Assignment operator. More... | |
virtual UBool | operator== (const Collator &other) const |
Returns true if argument is the same as this object. More... | |
virtual UBool | operator!= (const Collator &other) const |
Returns true if argument is not the same as this object. More... | |
virtual Collator * | clone (void) const |
Makes a deep copy of the object. More... | |
virtual CollationElementIterator * | createCollationElementIterator (const UnicodeString &source) const |
Creates a collation element iterator for the source string. More... | |
virtual CollationElementIterator * | createCollationElementIterator (const CharacterIterator &source) const |
Creates a collation element iterator for the source. More... | |
virtual EComparisonResult | compare (const UnicodeString &source, const UnicodeString &target) const |
Compares a range of character data stored in two different strings based on the collation rules. More... | |
virtual EComparisonResult | compare (const UnicodeString &source, const UnicodeString &target, int32_t length) const |
Compares a range of character data stored in two different strings based on the collation rules up to the specified length. More... | |
virtual EComparisonResult | compare (const UChar *source, int32_t sourceLength, const UChar *target, int32_t targetLength) const |
The comparison function compares the character data stored in two different string arrays. More... | |
virtual CollationKey & | getCollationKey (const UnicodeString &source, CollationKey &key, UErrorCode &status) const |
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. More... | |
virtual CollationKey & | getCollationKey (const UChar *source, int32_t sourceLength, CollationKey &key, UErrorCode &status) const |
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. More... | |
virtual int32_t | hashCode (void) const |
Generates the hash code for the rule-based collation object. More... | |
virtual const Locale | getLocale (UErrorCode &status) const |
Gets the locale of the Collator. More... | |
const UnicodeString & | getRules (void) const |
Gets the table-based rules for the collation object. More... | |
virtual void | getVersion (UVersionInfo info) const |
Gets the version information for a Collator. More... | |
int32_t | getMaxExpansion (int32_t order) const |
Return the maximum length of any expansion sequences that end with the specified comparison order. More... | |
virtual UClassID | getDynamicClassID (void) const |
Returns a unique class ID POLYMORPHICALLY. More... | |
uint8_t * | cloneRuleData (int32_t &length, UErrorCode &status) |
Returns the binary format of the class's rules. More... | |
void | getRules (UColRuleOption delta, UnicodeString &buffer) |
Returns current rules. More... | |
virtual void | setAttribute (UColAttribute attr, UColAttributeValue value, UErrorCode &status) |
Universal attribute setter. More... | |
virtual UColAttributeValue | getAttribute (UColAttribute attr, UErrorCode &status) |
Universal attribute getter. More... | |
virtual uint32_t | setVariableTop (const UChar *varTop, int32_t len, UErrorCode &status) |
Sets the variable top to a collation element value of a string supplied. More... | |
virtual uint32_t | setVariableTop (const UnicodeString varTop, UErrorCode &status) |
Sets the variable top to a collation element value of a string supplied. More... | |
virtual void | setVariableTop (const uint32_t varTop, UErrorCode &status) |
Sets the variable top to a collation element value supplied. More... | |
virtual uint32_t | getVariableTop (UErrorCode &status) const |
Gets the variable top value of a Collator. More... | |
virtual Collator * | safeClone (void) |
Thread safe cloning operation. More... | |
virtual int32_t | getSortKey (const UnicodeString &source, uint8_t *result, int32_t resultLength) const |
Get the sort key as an array of bytes from an UnicodeString. More... | |
virtual int32_t | getSortKey (const UChar *source, int32_t sourceLength, uint8_t *result, int32_t resultLength) const |
Get the sort key as an array of bytes from an UChar buffer. More... | |
virtual ECollationStrength | getStrength (void) const |
Determines the minimum strength that will be use in comparison or transformation. More... | |
virtual void | setStrength (ECollationStrength newStrength) |
Sets the minimum strength to be used in comparison or transformation. More... | |
RuleBasedCollator (const UnicodeString &rules, Normalizer::EMode decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
RuleBasedCollator (const UnicodeString &rules, ECollationStrength collationStrength, Normalizer::EMode decompositionMode, UErrorCode &status) | |
RuleBasedCollator constructor. More... | |
virtual void | setDecomposition (Normalizer::EMode mode) |
Set the decomposition mode of the Collator object. More... | |
virtual Normalizer::EMode | getDecomposition (void) const |
Get the decomposition mode of the Collator object. More... | |
Static Public Methods | |
UClassID | getStaticClassID (void) |
Returns the class ID for this class. More... | |
Friends | |
class | CollationElementIterator |
Used to iterate over collation elements in a character source. | |
class | Collator |
Collator ONLY needs access to RuleBasedCollator(const Locale&, UErrorCode&). | |
class | StringSearch |
Searching over collation elements in a character source. More... |
The user can create a customized table-based collation.
Important: The ICU collation service has been reimplemented in order to achieve better performance and UCA compliance. For details, see the collation design document.
RuleBasedCollator is a thin C++ wrapper over the C implementation.
For more information about the collation service see the users guide.
Collation service provides correct sorting orders for most locales supported in ICU. If specific data for a locale is not available, the orders eventually falls back to the UCA sort order.
Sort ordering may be customized by providing your own set of rules. For more on this subject see the Collation customization section of the users guide.
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
Copy constructor.
|
|
Destructor. @stable |
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
RuleBasedCollator constructor. This takes the table rules and builds a collation table out of them. Please see RuleBasedCollator class description for more details on the collation rule syntax.
|
|
Makes a deep copy of the object. The caller owns the returned object.
Implements Collator. |
|
Returns the binary format of the class's rules. The format is that of .col files.
|
|
The comparison function compares the character data stored in two different string arrays. Returns information about whether a string array is less than, greater than or equal to another string array. Example of use: . UErrorCode status = U_ZERO_ERROR; . Collator *myCollation = . Collator::createInstance(Locale::US, status); . if (U_FAILURE(status)) return; . myCollation->setStrength(Collator::PRIMARY); . // result would be Collator::EQUAL ("abc" == "ABC") . // (no primary difference between "abc" and "ABC") . Collator::UCollationResult result = . myCollation->compare(L"abc", 3, L"ABC", 3); . myCollation->setStrength(Collator::TERTIARY); . // result would be Collator::LESS (abc" <<< "ABC") . // (with tertiary difference between "abc" and "ABC") . Collator::UCollationResult result = . myCollation->compare(L"abc", 3, L"ABC", 3);
Implements Collator. |
|
Compares a range of character data stored in two different strings based on the collation rules up to the specified length. Returns information about whether a string is less than, greater than or equal to another string in a language. This can be overriden in a subclass.
Implements Collator. |
|
Compares a range of character data stored in two different strings based on the collation rules. Returns information about whether a string is less than, greater than or equal to another string in a language. This can be overriden in a subclass.
Implements Collator. |
|
Creates a collation element iterator for the source. The caller of this method is responsible for the memory management of the returned pointer.
|
|
Creates a collation element iterator for the source string. The caller of this method is responsible for the memory management of the return pointer.
|
|
Universal attribute getter.
Implements Collator. |
|
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. Use a CollationKey when you need to do repeated comparisions on the same string. For a single comparison the compare method will be faster.
Implements Collator. |
|
Transforms a specified region of the string into a series of characters that can be compared with CollationKey.compare. Use a CollationKey when you need to do repeated comparisions on the same string. For a single comparison the compare method will be faster.
Implements Collator. |
|
Get the decomposition mode of the Collator object.
Implements Collator. |
|
Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This method is to implement a simple version of RTTI, since not all C++ compilers support genuine RTTI. Polymorphic operator==() and clone() methods call this method.
Implements Collator. |
|
Gets the locale of the Collator.
Implements Collator. |
|
Return the maximum length of any expansion sequences that end with the specified comparison order.
|
|
Returns current rules. Delta defines whether full rules are returned or just the tailoring.
|
|
Gets the table-based rules for the collation object.
|
|
Get the sort key as an array of bytes from an UChar buffer.
Implements Collator. |
|
Get the sort key as an array of bytes from an UnicodeString.
Implements Collator. |
|
Returns the class ID for this class. This is useful only for comparing to a return value from getDynamicClassID(). For example: Base* polymorphic_pointer = createPolymorphicObject(); if (polymorphic_pointer->getDynamicClassID() == Derived::getStaticClassID()) ...
|
|
Determines the minimum strength that will be use in comparison or transformation.
E.g. with strength == SECONDARY, the tertiary difference is ignored E.g. with strength == PRIMARY, the secondary and tertiary difference are ignored.
Implements Collator. |
|
Gets the variable top value of a Collator. Lower 16 bits are undefined and should be ignored.
Implements Collator. |
|
Gets the version information for a Collator.
Implements Collator. |
|
Generates the hash code for the rule-based collation object.
Implements Collator. |
|
Returns true if argument is not the same as this object.
Reimplemented from Collator. |
|
Assignment operator.
|
|
Returns true if argument is the same as this object.
Reimplemented from Collator. |
|
Thread safe cloning operation.
Implements Collator. |
|
Universal attribute setter.
Implements Collator. |
|
Set the decomposition mode of the Collator object. success is equal to U_ILLEGAL_ARGUMENT_ERROR if error occurs.
Implements Collator. |
|
Sets the minimum strength to be used in comparison or transformation.
Implements Collator. |
|
Sets the variable top to a collation element value supplied. Variable top is set to the upper 16 bits. Lower 16 bits are ignored.
Implements Collator. |
|
Sets the variable top to a collation element value of a string supplied.
Implements Collator. |
|
Sets the variable top to a collation element value of a string supplied.
Implements Collator. |
|
Searching over collation elements in a character source. Created by: Helena Shih Modification History: Date Name Description 2/5/97 aliu Added streamIn and streamOut methods. Added constructor which reads RuleBasedCollator object from a binary file. Added writeToFile method which streams RuleBasedCollator out to a binary file. The streamIn and streamOut methods use istream and ostream objects in binary mode. 2/12/97 aliu Modified to use TableCollationData sub-object to hold invariant data. 2/13/97 aliu Moved several methods into this class from Collation. Added a private RuleBasedCollator(Locale&) constructor, to be used by Collator::createDefault(). General clean up. 2/20/97 helena Added clone, operator==, operator!=, operator=, and copy constructor and getDynamicClassID. 3/5/97 aliu Modified constructFromFile() to add parameter specifying whether or not binary loading is to be attempted. This is required for dynamic rule loading. 05/07/97 helena Added memory allocation error detection. 6/17/97 helena Added IDENTICAL strength for compare, changed getRules to use MergeCollation::getPattern. 6/20/97 helena Java class name change. 8/18/97 helena Added internal API documentation. 09/03/97 helena Added createCollationKeyValues(). 02/10/98 damiba Added compare with "length" parameter 08/05/98 erm Synched with 1.2 version of RuleBasedCollator.java 04/23/99 stephen Removed EDecompositionMode, merged with Normalizer::EMode 06/14/99 stephen Removed kResourceBundleSuffix 11/02/99 helena Collator performance enhancements. Eliminates the UnicodeString construction and special case for NO_OP. 11/23/99 srl More performance enhancements. Updates to NormalizerIterator internal state management. 12/15/99 aliu Update to support Thai collation. Move NormalizerIterator to implementation file. 01/29/01 synwee Modified into a C++ wrapper which calls C API (ucol.h) |