#include <colldata.h>

Public Member Functions | |
| UCollator * | getCollator () const |
Get the UCollator object used to create this object. | |
| const StringList * | getStringList (int32_t ce) const |
| Get a list of all the strings which generate a list of CEs starting with a given CE. | |
| const CEList * | getCEList (const UnicodeString *string) const |
| Get a list of the CEs generated by a partcular stirng. | |
| void | freeCEList (const CEList *list) |
Release a CEList returned by getCEList. | |
| int32_t | minLengthInChars (const CEList *ces, int32_t offset) const |
| Return the length of the shortest string that will generate the given list of CEs. | |
| int32_t | minLengthInChars (const CEList *ces, int32_t offset, int32_t *history) const |
| Return the length of the shortest string that will generate the given list of CEs. | |
| virtual UClassID | getDynamicClassID () const |
| UObject glue. | |
Static Public Member Functions | |
| static CollData * | open (UCollator *collator, UErrorCode &status) |
Construct a CollData object. | |
| static void | close (CollData *collData) |
Release a CollData object. | |
| static UClassID | getStaticClassID () |
| UObject glue. | |
| static void | freeCollDataCache () |
CollData objects are expensive to compute, and so may be cached. | |
| static void | flushCollDataCache () |
CollData objects are expensive to compute, and so may be cached. | |
Friends | |
| class | CollDataCache |
| class | CollDataCacheEntry |
This class holds the Collator-specific data needed to compute the length of the shortest string that can generate a partcular list of CEs.
CollData objects are quite expensive to compute. Because of this, they are cached. When you call CollData::open it returns a reference counted cached object. When you call CollData::close the reference count on the object is decremented but the object is not deleted.
If you do not need to reuse any unreferenced objects in the cache, you can call CollData::flushCollDataCache. If you no longer need any CollData objects, you can call CollData::freeCollDataCache
Definition at line 267 of file colldata.h.
| static void CollData::close | ( | CollData * | collData | ) | [static] |
| static void CollData::flushCollDataCache | ( | ) | [static] |
| void CollData::freeCEList | ( | const CEList * | list | ) |
| static void CollData::freeCollDataCache | ( | ) | [static] |
CollData objects are expensive to compute, and so may be cached.
This routine will free the cached objects and delete the cache.
WARNING: Don't call this until you are have called close for each CollData object that you have used. also, DO NOT call this if another thread may be calling flushCollDataCache at the same time.
| const CEList* CollData::getCEList | ( | const UnicodeString * | string | ) | const |
| UCollator* CollData::getCollator | ( | ) | const |
Get the UCollator object used to create this object.
The object returned may not be the exact object that was used to create this object, but it will have the same behavior.
| virtual UClassID CollData::getDynamicClassID | ( | ) | const [virtual] |
| const StringList* CollData::getStringList | ( | int32_t | ce | ) | const |
Get a list of all the strings which generate a list of CEs starting with a given CE.
| ce | - the CE |
StringList object containing all the stirngs, or NULL if there are no such strings.
Return the length of the shortest string that will generate the given list of CEs.
Note: the algorithm used to do this computation is recursive. To limit the amount of recursion, a "history" list is used to record the best answer starting at a particular offset in the list of CEs. If the same offset is visited again during the recursion, the answer in the history list is used.
| ces | - the CEs | |
| offset | - the offset of the first CE in the list to use. | |
| history | - the history list. Must be at least as long as the number of cEs in the CEList |
Return the length of the shortest string that will generate the given list of CEs.
| ces | - the CEs | |
| offset | - the offset of the first CE in the list to use. |
| static CollData* CollData::open | ( | UCollator * | collator, | |
| UErrorCode & | status | |||
| ) | [static] |
Construct a CollData object.
| collator | - the collator | |
| status | - will be set if any errors occur. |
CollData object. You must call close when you are done using the object.CollData::close.
1.5.7.1