tree.addFormat("", format);
return;
}
boolean isPrefix = true;
int sIndex = 0, eIndex = 0;
TrieTreeNode sCurrent = tree, eCurrent = tree;
if (prefix.length != 0) {
for (int i = 0; i < prefix.length; i++) {
TrieTreeNode node = sCurrent.getChildNode(prefix[i], true);
if (node == null) {
node = new TrieTreeNode();
sCurrent.addTreeNode(prefix[i], true, node);
sIndex++;
}
sCurrent = node;
}
}
if (suffix.length != 0) {
for (int i = suffix.length - 1; i >= 0; i--) {
TrieTreeNode node = eCurrent.getChildNode(suffix[i], false);
if (node == null) {
node = new TrieTreeNode();
eCurrent.addTreeNode(suffix[i], false, node);
eIndex++;
}
eCurrent = node;
}