Logo Search packages:      
Sourcecode: icu version File versions

virtual CollationKey& Collator::getCollationKey ( const UnicodeString source,
CollationKey key,
UErrorCode status 
) const [pure virtual]

Transforms the string into a series of characters that can be compared with CollationKey::compareTo. It is not possible to restore the original string from the chars in the sort key. The generated sort key handles only a limited number of ignorable characters.

Use CollationKey::equals or CollationKey::compare to compare the generated sort keys. If the source string is null, a null collation key will be returned.

sourcethe source string to be transformed into a sort key.
keythe collation key to be filled in
statusthe error code status.
the collation key of the string based on the collation rules.
See also:
ICU 2.8 Use getSortKey(...) instead

Implemented in RuleBasedCollator, and TestCollator.

Referenced by IntlTestCollator::doTestVariant(), CollationAPITest::TestCollationKey(), CollationThaiTest::TestDictionary(), CollationAPITest::TestHashCode(), and CollationAPITest::TestSortKey().

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index