/** * delete child from this node * @param childName the string name of the child to * be deleted */ void deleteChild(String childName) { synchronized(children) { if (!children.containsKey(childName)) { return; } TrieNode childNode = children.get(childName); // this is the only child node. if (childNode.getChildren().length == 1) { childNode.setParent(null); children.remove(childName); } else { // their are more child nodes // so just reset property. childNode.setProperty(false); } } }
/** * delete child from this node * @param childName the string name of the child to * be deleted */ void deleteChild(String childName) { synchronized(children) { if (!children.containsKey(childName)) { return; } TrieNode childNode = children.get(childName); // this is the only child node. if (childNode.getChildren().length == 1) { childNode.setParent(null); children.remove(childName); } else { // their are more child nodes // so just reset property. childNode.setProperty(false); } } }
/** * delete child from this node * @param childName the string name of the child to * be deleted */ void deleteChild(String childName) { synchronized(children) { if (!children.containsKey(childName)) { return; } TrieNode childNode = children.get(childName); // this is the only child node. if (childNode.getChildren().length == 1) { childNode.setParent(null); children.remove(childName); } else { // their are more child nodes // so just reset property. childNode.setProperty(false); } } }
/** * clear all nodes */ public void clear() { for(String child : rootNode.getChildren()) { rootNode.deleteChild(child); } } }
/** * clear all nodes */ public void clear() { for(String child : rootNode.getChildren()) { rootNode.deleteChild(child); } } }