Main Page   Class Hierarchy   Compound List   File List   Header Files   Sources   Compound Members   File Members  

RuleBasedCollator Class Reference

The RuleBasedCollator class provides the simple implementation of Collator, using data-driven tables. More...

#include <tblcoll.h>

Class diagram for RuleBasedCollator:

Collator

List of all members.


Public Members

 RuleBasedCollator (const UnicodeString& rules, UErrorCode& status)
RuleBasedCollator constructor. More...

 RuleBasedCollator ( const UnicodeString& rules, ECollationStrength collationStrength, UErrorCode& status)
 RuleBasedCollator ( const UnicodeString& rules, Normalizer::EMode decompositionMode, UErrorCode& status)
 RuleBasedCollator ( const UnicodeString& rules, ECollationStrength collationStrength, Normalizer::EMode decompositionMode, UErrorCode& status)
virtual ~RuleBasedCollator ()
Destructor. More...

 RuleBasedCollator (const RuleBasedCollator& other)
Copy constructor. More...

RuleBasedCollator& operator= (const RuleBasedCollator& other)
Assignment operator. More...

virtual UBool operator== (const Collator& other) const
Returns true if "other" is the same as "this". More...

virtual UBool operator!= (const Collator& other) const
Returns true if "other" is not the same as "this". More...

virtual Collatorclone (void) const
Makes a deep copy of the object. More...

virtual CollationElementIteratorcreateCollationElementIterator (const UnicodeString& source) const
Creates a collation element iterator for the source string. More...

virtual CollationElementIteratorcreateCollationElementIterator (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 CollationKeygetCollationKey ( 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 CollationKeygetCollationKey (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...

const UnicodeStringgetRules (void) const
Gets the table-based rules for the collation object. 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_tcloneRuleData (int32_t &length, UErrorCode &status)
Returns the binary format of the class's rules. More...


Static Public Members

UClassID getStaticClassID (void)
Returns the class ID for this class. More...


Friends

class  RuleBasedCollatorStreamer
class  CollationElementIterator
class  Collator
class  TableCollationData

Detailed Description

The RuleBasedCollator class provides the simple implementation of Collator, using data-driven tables.

The user can create a customized table-based collation.

RuleBasedCollator maps characters to collation keys.

Table Collation has the following restrictions for efficiency (other subclasses may be used for more complex languages) :

1. If the French secondary ordering is specified in a collation object, it is applied to the whole object.

2. All non-mentioned Unicode characters are at the end of the collation order.

3. Private use characters are treated as identical. The private use area in Unicode is 0xE800-0xF8FF.

The collation table is composed of a list of collation rules, where each rule is of three forms:

 .    &lt; modifier >
 .    &lt; relation > &lt; text-argument >
 .    &lt; reset > &lt; text-argument >
 
The following demonstrates how to create your own collation rules: