ICU 50.1.2
50.1.2
|
#include <colldata.h>
Public Member Functions | |
UCollator * | getCollator () const |
Get the UCollator object used to create this object. More... | |
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. More... | |
const CEList * | getCEList (const UnicodeString *string) const |
Get a list of the CEs generated by a partcular stirng. More... | |
void | freeCEList (const CEList *list) |
Release a CEList returned by getCEList . More... | |
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. More... | |
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. More... | |
virtual UClassID | getDynamicClassID () const |
UObject glue... More... | |
![]() | |
virtual | ~UObject () |
Destructor. More... | |
Static Public Member Functions | |
static CollData * | open (UCollator *collator, UErrorCode &status) |
Construct a CollData object. More... | |
static void | close (CollData *collData) |
Release a CollData object. More... | |
static UClassID | getStaticClassID () |
UObject glue... More... | |
static void | freeCollDataCache () |
CollData objects are expensive to compute, and so may be cached. More... | |
static void | flushCollDataCache () |
CollData objects are expensive to compute, and so may be cached. More... | |
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 282 of file colldata.h.
|
static |
|
static |
void icu::CollData::freeCEList | ( | const CEList * | list | ) |
|
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* icu::CollData::getCEList | ( | const UnicodeString * | string | ) | const |
UCollator* icu::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 |
UObject glue...
Implements icu::UObject.
|
static |
const StringList* icu::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 |
return a StringList
object containing all the stirngs, or NULL
if there are no such strings.
int32_t icu::CollData::minLengthInChars | ( | const CEList * | ces, |
int32_t | offset | ||
) | const |
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. |
int32_t icu::CollData::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.
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 |
|
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.Note: if on return, status is set to an error code, the only safe thing to do with this object is to call CollData::close
.