private static final class WordSet.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) char[] |
mData |
(package private) int |
mSize
Number of characters currently used from mData
|
(package private) java.lang.String[] |
mWords |
Constructor and Description |
---|
Builder(java.util.TreeSet<java.lang.String> wordSet) |
Modifier and Type | Method and Description |
---|---|
char[] |
construct() |
private void |
constructBranch(int charIndex,
int start,
int end)
Method that is called recursively to build the data
representation for a branch, ie.
|
private void |
constructLeaf(int charIndex,
int wordIndex)
Method called to add leaf entry to word set; basically
"here is the rest of the only matching word"
|
private char[] |
expand(int needSpace) |
final java.lang.String[] mWords
char[] mData
int mSize
public char[] construct()
private void constructBranch(int charIndex, int start, int end)
charIndex
- Index of the character in words to consider
for this roundstart
- Index of the first word to be processedend
- Index of the word after last word to be processed
(so that number of words is end - start - 1
private void constructLeaf(int charIndex, int wordIndex)
private char[] expand(int needSpace)