Example #1
0
  private List<IContainer> findAllContainer(
      final IContainer container, final INode[] nodes, final int level) {
    List<IContainer> result = new ArrayList<IContainer>();
    if (container != null) {
      if (container instanceof HdfGroup) {
        HdfGroup group = (HdfGroup) container;
        if (nodes.length > level) {
          // List current node children
          List<INode> childs = group.getChildNodes();

          INode current = nodes[level];

          for (INode node : childs) {

            if (node.matchesPartNode(current)) {
              if (level < nodes.length - 1) {
                result.addAll(
                    findAllContainer(group.getContainer(node.getName()), nodes, level + 1));
              }
              // Create IContainer and add it to result list
              else {
                result.add(group.getContainer(node.getName()));
              }
            }
          }
        }
      } else {
        HdfDataItem dataItem = (HdfDataItem) container;
        result.add(dataItem);
      }
    }
    return result;
  }
Example #2
0
  private List<IContainer> findAllContainer(IContainer container, INode[] nodes, int level) {
    List<IContainer> result = new ArrayList<IContainer>();
    if (container != null) {
      if (container instanceof EdfGroup) {
        EdfGroup group = (EdfGroup) container;
        if (nodes.length > level) {
          // List current node children
          if (group.isAcquisitionGroup()) {
            for (EdfGroup realGroup : groupList) {
              result.addAll(findAllContainer(realGroup, nodes, level));
            }
          }

          List<INode> childs = group.getNodes();

          INode current = nodes[level];

          for (INode node : childs) {
            if (current.matchesPartNode(node)) {

              if (level < nodes.length - 1) {
                result.addAll(
                    findAllContainer(group.getContainer(node.getName()), nodes, level + 1));
              }
              // Create IContainer and add it to result list
              else {
                result.add(group.getContainer(node.getName()));
              }
            }
          }
        }
      } else {
        EdfDataItem dataItem = (EdfDataItem) container;
        result.add(dataItem);
      }
    }
    return result;
  }