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

CompactShortArray Struct Reference

class CompactATypeArray : use only on primitive data types Provides a compact way to store information that is indexed by Unicode values, such as character properties, types, keyboard values, etc.This is very useful when you have a block of Unicode data that contains significant values while the rest of the Unicode data is unused in the application or when you have a lot of redundance, such as where all 21,000 Han ideographs have the same value. More...

#include <ucmp16.h>

List of all members.

Public Attributes

int32_t fStructSize
int16_tfArray
uint16_tfIndex
int32_tfHashes
int32_t fCount
int16_t fDefaultValue
UBool fCompact
UBool fBogus
UBool fAlias
int32_t kBlockShift
int32_t kBlockMask
UBool fIAmOwned


Detailed Description

class CompactATypeArray : use only on primitive data types Provides a compact way to store information that is indexed by Unicode values, such as character properties, types, keyboard values, etc.This is very useful when you have a block of Unicode data that contains significant values while the rest of the Unicode data is unused in the application or when you have a lot of redundance, such as where all 21,000 Han ideographs have the same value.

However, lookup is much faster than a hash table.

A compact array of any primitive data type serves two purposes:

The index array always points into particular parts of the data array it is initially set up to point at regular block boundaries The following example uses blocks of 4 for simplicity

 Example: Expanded
 BLOCK  0   1   2   3   4
 INDEX  0   4   8   12  16 ...
 ARRAY  abcdeababcdezyabcdea...
        |   |   |   |   |   |...
 

After compression, the index will point to various places in the data array wherever there is a runs of the same elements as in the original

 Example: Compressed
 BLOCK  0   1   2   3   4
 INDEX  0   4   1   8   2 ...
 ARRAY  abcdeabazyabc...
 

If you look at the example, index number 2 in the expanded version points to data position number 8, which has elements "bcde". In the compressed version, index number 2 points to data position 1, which also has "bcde"

See also:
CompactByteArray , CompactIntArray , CompactCharArray , CompactStringArray
Version:
Revision:
1.15
8/25/98
Author(s):
Helena Shih

Definition at line 87 of file ucmp16.h.


Member Data Documentation

UBool CompactShortArray::fAlias
 

Definition at line 96 of file ucmp16.h.

int16_t * CompactShortArray::fArray
 

Definition at line 89 of file ucmp16.h.

UBool CompactShortArray::fBogus
 

Definition at line 95 of file ucmp16.h.

UBool CompactShortArray::fCompact
 

Definition at line 94 of file ucmp16.h.

int32_t CompactShortArray::fCount
 

Definition at line 92 of file ucmp16.h.

int16_t CompactShortArray::fDefaultValue
 

Definition at line 93 of file ucmp16.h.

int32_t * CompactShortArray::fHashes
 

Definition at line 91 of file ucmp16.h.

UBool CompactShortArray::fIAmOwned
 

Definition at line 99 of file ucmp16.h.

uint16_t * CompactShortArray::fIndex
 

Definition at line 90 of file ucmp16.h.

int32_t CompactShortArray::fStructSize
 

Definition at line 88 of file ucmp16.h.

int32_t CompactShortArray::kBlockMask
 

Definition at line 98 of file ucmp16.h.

int32_t CompactShortArray::kBlockShift
 

Definition at line 97 of file ucmp16.h.


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