Exemplo n.º 1
0
 public void iterateFileNames(IndexEntriesWalkerInterruptable iproc) {
   for (FileEntitiesHolder d : files.values()) {
     //            iproc.process(d.getPath(), Long.toString(d.timeStamp));
     if (!iproc.process(d.getPath(), d.value)) {
       return;
     }
   }
 }
Exemplo n.º 2
0
 public void iterateTopNodes(String name, IndexEntriesWalkerInterruptable iproc) {
   List<TreeNodeImpl> list = root.childs.get(name.toLowerCase());
   if (list != null) {
     for (TreeNode n : list) {
       if (!iproc.process(n.getPath(), n.getValue())) {
         return;
       }
     }
   }
 }
Exemplo n.º 3
0
 public void iterateTopNodes(IndexEntriesWalkerInterruptable iproc) {
   // iterate thru children
   for (Map.Entry<String, List<TreeNodeImpl>> item : root.childs.entrySet()) {
     for (TreeNode n : item.getValue()) {
       if (!iproc.process(n.getPath(), n.getValue())) {
         return;
       }
     }
   }
 }
Exemplo n.º 4
0
 public void iterateTopNodesForFile(String _filePath, IndexEntriesWalkerInterruptable iproc) {
   String filePath = _filePath.replace(' ', '?').replace('\\', '|').replace('/', '|');
   FileEntitiesHolder fileHolder = files.get(filePath);
   if (fileHolder != null) {
     for (TreeNodeTop d : fileHolder.nodes) {
       if (!iproc.process(d.getPath(), d.getValue())) {
         return;
       }
     }
   }
 }
Exemplo n.º 5
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;
        }
      }
    }
  }