}
}
}
public void addWord(Element root, String word) {
DicMap last = this.map;
Element current = root;
int len = word.length();
// For each letter
Character key = null;
DicMap tree = null;
for (int i = 0; i < len; i++) {
// Get key (letter)
key = word.charAt(i);
// Search at this key
tree = last.get(key);
if (tree == null) {
tree = FACTORY.createDicMap(true);
// Declare as last for last letter
if (i == (len - 1)) {
tree.setLast();
}
last.put(key, tree);
}
// Build dictionary into xml