Package com.ibm.icu.util
Class StringTrieBuilder
- java.lang.Object
-
- com.ibm.icu.util.StringTrieBuilder
-
- Direct Known Subclasses:
BytesTrieBuilder
,CharsTrieBuilder
public abstract class StringTrieBuilder extends java.lang.Object
Base class for string trie builder classes.This class is not intended for public subclassing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
StringTrieBuilder.BranchHeadNode
private static class
StringTrieBuilder.BranchNode
private static class
StringTrieBuilder.DynamicBranchNode
private static class
StringTrieBuilder.IntermediateValueNode
private static class
StringTrieBuilder.LinearMatchNode
private static class
StringTrieBuilder.ListBranchNode
private static class
StringTrieBuilder.Node
static class
StringTrieBuilder.Option
Build options for BytesTrieBuilder and CharsTrieBuilder.private static class
StringTrieBuilder.SplitBranchNode
private static class
StringTrieBuilder.State
private static class
StringTrieBuilder.ValueNode
-
Field Summary
Fields Modifier and Type Field Description private StringTrieBuilder.ValueNode
lookupFinalValueNode
private java.util.HashMap<StringTrieBuilder.Node,StringTrieBuilder.Node>
nodes
private StringTrieBuilder.Node
root
private StringTrieBuilder.State
state
protected java.lang.StringBuilder
strings
Deprecated.This API is ICU internal only.
-
Constructor Summary
Constructors Modifier Constructor Description protected
StringTrieBuilder()
Deprecated.This API is ICU internal only.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addImpl(java.lang.CharSequence s, int value)
Deprecated.This API is ICU internal only.protected void
buildImpl(StringTrieBuilder.Option buildOption)
Deprecated.This API is ICU internal only.protected void
clearImpl()
Deprecated.This API is ICU internal only.private StringTrieBuilder.ValueNode
createSuffixNode(java.lang.CharSequence s, int start, int sValue)
protected abstract int
getMaxBranchLinearSubNodeLength()
Deprecated.This API is ICU internal only.protected abstract int
getMaxLinearMatchLength()
Deprecated.This API is ICU internal only.protected abstract int
getMinLinearMatch()
Deprecated.This API is ICU internal only.protected abstract boolean
matchNodesCanHaveValues()
Deprecated.This API is ICU internal only.private StringTrieBuilder.ValueNode
registerFinalValue(int value)
Makes sure that there is only one unique FinalValueNode registered with this value.private StringTrieBuilder.Node
registerNode(StringTrieBuilder.Node newNode)
Makes sure that there is only one unique node registered that is equivalent to newNode, unless BUILDING_FAST.protected abstract int
write(int unit)
Deprecated.This API is ICU internal only.protected abstract int
write(int offset, int length)
Deprecated.This API is ICU internal only.protected abstract int
writeDeltaTo(int jumpTarget)
Deprecated.This API is ICU internal only.protected abstract int
writeValueAndFinal(int i, boolean isFinal)
Deprecated.This API is ICU internal only.protected abstract int
writeValueAndType(boolean hasValue, int value, int node)
Deprecated.This API is ICU internal only.
-
-
-
Field Detail
-
state
private StringTrieBuilder.State state
-
strings
@Deprecated protected java.lang.StringBuilder strings
Deprecated.This API is ICU internal only.
-
root
private StringTrieBuilder.Node root
-
nodes
private java.util.HashMap<StringTrieBuilder.Node,StringTrieBuilder.Node> nodes
-
lookupFinalValueNode
private StringTrieBuilder.ValueNode lookupFinalValueNode
-
-
Method Detail
-
addImpl
@Deprecated protected void addImpl(java.lang.CharSequence s, int value)
Deprecated.This API is ICU internal only.
-
buildImpl
@Deprecated protected final void buildImpl(StringTrieBuilder.Option buildOption)
Deprecated.This API is ICU internal only.
-
clearImpl
@Deprecated protected void clearImpl()
Deprecated.This API is ICU internal only.
-
registerNode
private final StringTrieBuilder.Node registerNode(StringTrieBuilder.Node newNode)
Makes sure that there is only one unique node registered that is equivalent to newNode, unless BUILDING_FAST.- Parameters:
newNode
- Input node. The builder takes ownership.- Returns:
- newNode if it is the first of its kind, or an equivalent node if newNode is a duplicate.
-
registerFinalValue
private final StringTrieBuilder.ValueNode registerFinalValue(int value)
Makes sure that there is only one unique FinalValueNode registered with this value. Avoids creating a node if the value is a duplicate.- Parameters:
value
- A final value.- Returns:
- A FinalValueNode with the given value.
-
createSuffixNode
private StringTrieBuilder.ValueNode createSuffixNode(java.lang.CharSequence s, int start, int sValue)
-
matchNodesCanHaveValues
@Deprecated protected abstract boolean matchNodesCanHaveValues()
Deprecated.This API is ICU internal only.
-
getMaxBranchLinearSubNodeLength
@Deprecated protected abstract int getMaxBranchLinearSubNodeLength()
Deprecated.This API is ICU internal only.
-
getMinLinearMatch
@Deprecated protected abstract int getMinLinearMatch()
Deprecated.This API is ICU internal only.
-
getMaxLinearMatchLength
@Deprecated protected abstract int getMaxLinearMatchLength()
Deprecated.This API is ICU internal only.
-
write
@Deprecated protected abstract int write(int unit)
Deprecated.This API is ICU internal only.
-
write
@Deprecated protected abstract int write(int offset, int length)
Deprecated.This API is ICU internal only.
-
writeValueAndFinal
@Deprecated protected abstract int writeValueAndFinal(int i, boolean isFinal)
Deprecated.This API is ICU internal only.
-
writeValueAndType
@Deprecated protected abstract int writeValueAndType(boolean hasValue, int value, int node)
Deprecated.This API is ICU internal only.
-
writeDeltaTo
@Deprecated protected abstract int writeDeltaTo(int jumpTarget)
Deprecated.This API is ICU internal only.
-
-