result.append(toString((TrieNode) node.getChildAt(i)));
result.append(toString((TrieNode) node.getChildAt(i)));
/** * determines the common prefix of the nodes. * * @param currentPrefix the common prefix found so far * @return the result of the search */ protected String determineCommonPrefix(String currentPrefix) { String result; String newPrefix; if (!isRoot() && (getChar() != STOP)) { newPrefix = currentPrefix + getChar(); } else { newPrefix = currentPrefix; } if (m_Children.size() == 1) { result = ((TrieNode) getChildAt(0)).determineCommonPrefix(newPrefix); } else { result = newPrefix; } return result; }
/** * determines the common prefix of the nodes. * * @param currentPrefix the common prefix found so far * @return the result of the search */ protected String determineCommonPrefix(String currentPrefix) { String result; String newPrefix; if (!isRoot() && (getChar() != STOP)) { newPrefix = currentPrefix + getChar(); } else { newPrefix = currentPrefix; } if (m_Children.size() == 1) { result = ((TrieNode) getChildAt(0)).determineCommonPrefix(newPrefix); } else { result = newPrefix; } return result; }