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.
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:
- Fast access of the indexed values.
- Smaller memory footprint.
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
|
|
int16_t * CompactShortArray::fArray
|
|
UBool CompactShortArray::fBogus
|
|
UBool CompactShortArray::fCompact
|
|
int16_t CompactShortArray::fDefaultValue
|
|
int32_t * CompactShortArray::fHashes
|
|
UBool CompactShortArray::fIAmOwned
|
|
int32_t CompactShortArray::fStructSize
|
|
int32_t CompactShortArray::kBlockMask
|
|
int32_t CompactShortArray::kBlockShift
|
|
The documentation for this struct was generated from the following file:
Generated at Tue Dec 5 17:56:01 2000 for ICU by
1.2.3 written by Dimitri van Heesch,
© 1997-2000