Package com.ibm.icu.util
Class CharsTrieBuilder
- java.lang.Object
-
- com.ibm.icu.util.StringTrieBuilder
-
- com.ibm.icu.util.CharsTrieBuilder
-
public final class CharsTrieBuilder extends StringTrieBuilder
Builder class for CharsTrie.This class is not intended for public subclassing.
- Author:
- Markus W. Scherer
- Status:
- Stable ICU 4.8.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.icu.util.StringTrieBuilder
StringTrieBuilder.Option
-
-
Field Summary
-
Fields inherited from class com.ibm.icu.util.StringTrieBuilder
strings
-
-
Constructor Summary
Constructors Constructor Description CharsTrieBuilder()Constructs an empty builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CharsTrieBuilderadd(CharSequence s, int value)Adds a (string, value) pair.CharsTriebuild(StringTrieBuilder.Option buildOption)Builds a CharsTrie for the add()ed data.CharSequencebuildCharSequence(StringTrieBuilder.Option buildOption)Builds a CharsTrie for the add()ed data and char-serializes it.CharsTrieBuilderclear()Removes all (string, value) pairs.protected intgetMaxBranchLinearSubNodeLength()Deprecated.This API is ICU internal only.protected intgetMaxLinearMatchLength()Deprecated.This API is ICU internal only.protected intgetMinLinearMatch()Deprecated.This API is ICU internal only.protected booleanmatchNodesCanHaveValues()Deprecated.This API is ICU internal only.protected intwrite(int unit)Deprecated.This API is ICU internal only.protected intwrite(int offset, int length)Deprecated.This API is ICU internal only.protected intwriteDeltaTo(int jumpTarget)Deprecated.This API is ICU internal only.protected intwriteValueAndFinal(int i, boolean isFinal)Deprecated.This API is ICU internal only.protected intwriteValueAndType(boolean hasValue, int value, int node)Deprecated.This API is ICU internal only.-
Methods inherited from class com.ibm.icu.util.StringTrieBuilder
addImpl, buildImpl, clearImpl
-
-
-
-
Method Detail
-
add
public CharsTrieBuilder add(CharSequence s, int value)
Adds a (string, value) pair. The string must be unique. The string contents will be copied; the builder does not keep a reference to the input CharSequence.- Parameters:
s- The input string.value- The value associated with this char sequence.- Returns:
- this
- Status:
- Stable ICU 4.8.
-
build
public CharsTrie build(StringTrieBuilder.Option buildOption)
Builds a CharsTrie for the add()ed data. Once built, no further data can be add()ed until clear() is called.A CharsTrie cannot be empty. At least one (string, value) pair must have been add()ed.
Multiple calls to build() or buildCharSequence() return tries or sequences which share the builder's char array, without rebuilding. After clear() has been called, a new array will be used.
- Parameters:
buildOption- Build option, see StringTrieBuilder.Option.- Returns:
- A new CharsTrie for the add()ed data.
- Status:
- Stable ICU 4.8.
-
buildCharSequence
public CharSequence buildCharSequence(StringTrieBuilder.Option buildOption)
Builds a CharsTrie for the add()ed data and char-serializes it. Once built, no further data can be add()ed until clear() is called.A CharsTrie cannot be empty. At least one (string, value) pair must have been add()ed.
Multiple calls to build() or buildCharSequence() return tries or sequences which share the builder's char array, without rebuilding. After clear() has been called, a new array will be used.
- Parameters:
buildOption- Build option, see StringTrieBuilder.Option.- Returns:
- A CharSequence with the char-serialized CharsTrie for the add()ed data.
- Status:
- Stable ICU 4.8.
-
clear
public CharsTrieBuilder clear()
Removes all (string, value) pairs. New data can then be add()ed and a new trie can be built.- Returns:
- this
- Status:
- Stable ICU 4.8.
-
matchNodesCanHaveValues
@Deprecated protected boolean matchNodesCanHaveValues()
Deprecated.This API is ICU internal only.- Specified by:
matchNodesCanHaveValuesin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
getMaxBranchLinearSubNodeLength
@Deprecated protected int getMaxBranchLinearSubNodeLength()
Deprecated.This API is ICU internal only.- Specified by:
getMaxBranchLinearSubNodeLengthin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
getMinLinearMatch
@Deprecated protected int getMinLinearMatch()
Deprecated.This API is ICU internal only.- Specified by:
getMinLinearMatchin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
getMaxLinearMatchLength
@Deprecated protected int getMaxLinearMatchLength()
Deprecated.This API is ICU internal only.- Specified by:
getMaxLinearMatchLengthin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
write
@Deprecated protected int write(int unit)
Deprecated.This API is ICU internal only.- Specified by:
writein classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
write
@Deprecated protected int write(int offset, int length)
Deprecated.This API is ICU internal only.- Specified by:
writein classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
writeValueAndFinal
@Deprecated protected int writeValueAndFinal(int i, boolean isFinal)
Deprecated.This API is ICU internal only.- Specified by:
writeValueAndFinalin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
writeValueAndType
@Deprecated protected int writeValueAndType(boolean hasValue, int value, int node)
Deprecated.This API is ICU internal only.- Specified by:
writeValueAndTypein classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
writeDeltaTo
@Deprecated protected int writeDeltaTo(int jumpTarget)
Deprecated.This API is ICU internal only.- Specified by:
writeDeltaToin classStringTrieBuilder- Status:
- Internal. This API is ICU internal only.
-
-