for (i = 0; i < node.getLevel(); i++) { indentation.append(" | ");
for (i = 0; i < node.getLevel(); i++) { indentation.append(" | ");
/** * returns the full string up to the root * * @return the full string to the root */ public String getString() { char[] result; TrieNode node; result = new char[this.getLevel()]; node = this; while (node.getParent() != null) { if (node.isRoot()) { break; } else { result[node.getLevel() - 1] = node.getChar(); } node = (TrieNode) node.getParent(); } return new String(result); }
/** * returns the full string up to the root * * @return the full string to the root */ public String getString() { char[] result; TrieNode node; result = new char[this.getLevel()]; node = this; while (node.getParent() != null) { if (node.isRoot()) { break; } else { result[node.getLevel() - 1] = node.getChar(); } node = (TrieNode) node.getParent(); } return new String(result); }