Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CollationCache Class Reference

CollationCache implements a simple cache for TableCollationData objects. More...

#include <colcache.h>

List of all members.

Public Methods

 CollationCache ()
 Default constructor.

 ~CollationCache ()
 Destructor. More...

void Add (const UnicodeString& key, TableCollationData* adoptedData)
 Add and Find use a UnicodeString as the key to Collation objects in the cache. More...

TableCollationDataFind (const UnicodeString& key)


Detailed Description

CollationCache implements a simple cache for TableCollationData objects.

TableCollationData objects may be added to the cache, and looked up in the cache. When the cache is destroyed, all the TableCollationData objects are deleted.

Definition at line 52 of file colcache.h.


Constructor & Destructor Documentation

CollationCache::CollationCache ( )
 

Default constructor.

CollationCache::~CollationCache ( ) [inline]
 

Destructor.

Definition at line 63 of file colcache.h.


Member Function Documentation

void CollationCache::Add ( const UnicodeString & key,
TableCollationData * adoptedValue ) [inline]
 

Add and Find use a UnicodeString as the key to Collation objects in the cache.

If Add is called twice with equivalent keys, but different collation objects, the first collation object will be deleted when the second one is added. In general, this is undesirable; objects in the cache are usually pointed to by various clients in the system. For this reason, clients should call Find to ensure a Collation object does not already exist in the cache for the given key before calling Add.

Parameters:
key   the unique key.
data   the collation data object.
Returns:
the found collation data object

Definition at line 84 of file colcache.h.

TableCollationData * CollationCache::Find ( const UnicodeString & keyString ) [inline]
 

Definition at line 89 of file colcache.h.


The documentation for this class was generated from the following file:
Generated at Tue Dec 5 17:55:59 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000