Stores preprocessed comparison information for a Unicode string to speed repeated string comparisons. More...
#include <rw/i18n/RWUCollationKey.h>
Public Member Functions | |
RWUCollationKey (void) | |
RWUCollationKey (const RWUCollationKey &original) | |
~RWUCollationKey (void) | |
RWUString | getString (void) const |
unsigned | hash () const |
bool | isValid (void) const |
bool | operator!= (const RWUCollationKey &rhs) const |
bool | operator< (const RWUCollationKey &rhs) const |
RWUCollationKey & | operator= (const RWUCollationKey &rhs) |
bool | operator== (const RWUCollationKey &rhs) const |
RWUCollationKey stores preprocessed comparison information for a Unicode string, and can be used to speed repeated string comparisons. For example, you might choose to use collation keys when sorting a set of strings.
To create a valid RWUCollationKey, call RWUCollator::getCollationKey(). Generating a key is a non-trivial operation, since it involves determining the collation elements and weights for an entire string. Comparing two RWUCollationKey objects, however, is fast.
Program output:
|
inline |
Default constructor. Creates an invalid key.
Invalid keys are equal to each other, and not equal to any other key. They are less than all other keys. Calling getString() on an invalid key results in an RWUException.
This constructor exists only as a convenience–for example, when creating an array of RWUCollationKey objects. To create a valid, usable RWUCollationKey, call RWUCollator::getCollationKey().
RWUCollationKey::RWUCollationKey | ( | const RWUCollationKey & | original | ) |
Copy constructor. Makes self a deep copy of original.
|
inline |
Destructor.
RWUString RWUCollationKey::getString | ( | void | ) | const |
Returns the string whose collation value self holds. Throws RWUException if self is an invalid key.
|
inline |
Returns a hash value for self.
|
inline |
Returns true
if self is a valid key; otherwise, false
.
bool RWUCollationKey::operator!= | ( | const RWUCollationKey & | rhs | ) | const |
Returns true
if self does not compare equal to collation key rhs; otherwise false
.
bool RWUCollationKey::operator< | ( | const RWUCollationKey & | rhs | ) | const |
Returns true
if self compares less than collation key rhs; otherwise false
.
RWUCollationKey& RWUCollationKey::operator= | ( | const RWUCollationKey & | rhs | ) |
Assignment operator. Makes self a deep copy of rhs.
bool RWUCollationKey::operator== | ( | const RWUCollationKey & | rhs | ) | const |
Returns true
if self compares equal to collation key rhs; otherwise false
.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |