Exemplo n.º 1
0
  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);
        }
      }
    }
  }
Exemplo n.º 2
0
  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;
        }
      }
    }
  }
Exemplo n.º 3
0
 public String getParentPath() {
   return parent.getPath();
 }
Exemplo n.º 4
0
 public String getPath() {
   return (parent != null ? parent.getPath() : "") + encodedName;
 }