public class IntTrieBuilder extends TrieBuilder
TrieBuilder.DataManipulate| Modifier and Type | Field and Description |
|---|---|
protected int[] |
m_data_ |
protected int |
m_initialValue_ |
BMP_INDEX_LENGTH_, DATA_BLOCK_LENGTH, DATA_GRANULARITY_, INDEX_SHIFT_, m_dataCapacity_, m_dataLength_, m_index_, m_indexLength_, m_isCompacted_, m_isLatin1Linear_, m_map_, MASK_, MAX_DATA_LENGTH_, MAX_INDEX_LENGTH_, OPTIONS_DATA_IS_32_BIT_, OPTIONS_INDEX_SHIFT_, OPTIONS_LATIN1_IS_LINEAR_, SHIFT_, SURROGATE_BLOCK_COUNT_| Constructor and Description |
|---|
IntTrieBuilder(int[] aliasdata,
int maxdatalength,
int initialvalue,
int leadunitvalue,
boolean latin1linear)
Constructs a build table
|
IntTrieBuilder(IntTrieBuilder table)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getValue(int ch)
Gets a 32 bit data from the table data
|
int |
getValue(int ch,
boolean[] inBlockZero)
Get a 32 bit data from the table data
|
int |
serialize(OutputStream os,
boolean reduceTo16Bits,
TrieBuilder.DataManipulate datamanipulate)
Serializes the build table to an output stream.
|
IntTrie |
serialize(TrieBuilder.DataManipulate datamanipulate,
Trie.DataManipulate triedatamanipulate)
Serializes the build table with 32 bit data
|
boolean |
setRange(int start,
int limit,
int value,
boolean overwrite)
Set a value in a range of code points [start..limit].
|
boolean |
setValue(int ch,
int value)
Sets a 32 bit data in the table data
|
equal_int, findSameIndexBlock, findUnusedBlocks, isInZeroBlockpublic IntTrieBuilder(IntTrieBuilder table)
public IntTrieBuilder(int[] aliasdata,
int maxdatalength,
int initialvalue,
int leadunitvalue,
boolean latin1linear)
aliasdata - data to be filled into tablemaxdatalength - maximum data length allowed in tableinitialvalue - initial data valuelatin1linear - is latin 1 to be linearpublic int getValue(int ch)
ch - codepoint which data is to be retrievedpublic int getValue(int ch,
boolean[] inBlockZero)
ch - code point for which data is to be retrieved.inBlockZero - Output parameter, inBlockZero[0] returns true if the
char maps into block zero, otherwise false.public boolean setValue(int ch,
int value)
ch - codepoint which data is to be setvalue - to setpublic IntTrie serialize(TrieBuilder.DataManipulate datamanipulate, Trie.DataManipulate triedatamanipulate)
datamanipulate - builder raw fold method implementationtriedatamanipulate - result trie fold methodpublic int serialize(OutputStream os, boolean reduceTo16Bits, TrieBuilder.DataManipulate datamanipulate) throws IOException
os - the output stream to which the seriaized trie will be written.
If nul, the function still returns the size of the serialized Trie.reduceTo16Bits - If true, reduce the data size to 16 bits. The resulting
serialized form can then be used to create a CharTrie.datamanipulate - builder raw fold method implementationIOExceptionpublic boolean setRange(int start,
int limit,
int value,
boolean overwrite)
start - the first code point to get the valuelimit - one past the last code point to get the valuevalue - the valueoverwrite - flag for whether old non-initial values are to be
overwritten