private void findValuedNode(TreeNodeImpl node, IndexEntriesWalker iproc) { if (node.childs.size() == 0) { iproc.process(node.getPath(), node.value, node.extAttr); } else { // first call handler for root node then for children iproc.process(node.getPath(), node.value, node.extAttr); // iterate thru children for (String name : node.childs.keySet()) { for (TreeNode n : node.childs.get(name)) { findValuedNode((TreeNodeImpl) n, iproc); } } } }
public void iterateOverChildren(String ctxPath, IndexEntriesWalkerInterruptable iterator) { String[] path = ctxPath.split("/"); int startWith = ("/" + path[1]).startsWith(ContextPath.FILE_CTX_PRX) ? 2 : 1; TreeNode cycled = root; for (int i = startWith; i < path.length; i++) { String encodedName = "/" + path[i]; cycled = cycled.findChildByEncodedName(encodedName); if (cycled == null) { return; } } for (List<TreeNodeImpl> siblings : ((TreeNodeImpl) cycled).childs.values()) { for (TreeNodeImpl n : siblings) { if (!iterator.process(n.getPath(), n.value)) { return; } } } }
public String getParentPath() { return parent.getPath(); }
public String getPath() { return (parent != null ? parent.getPath() : "") + encodedName; }