コード例 #1
0
  public DatasetScanFilter(List<Selector> selectorGroup) {
    if (selectorGroup == null || selectorGroup.isEmpty()) {
      this.selectorGroup = Collections.emptyList();
      this.containsAtomicIncluders = false;
      this.containsAtomicExcluders = false;
      this.containsCollectionIncluders = false;
      this.containsCollectionExcluders = false;

    } else {
      boolean anyAtomicIncluders = false;
      boolean anyAtomicExcluders = false;
      boolean anyCollectionIncluders = false;
      boolean anyCollectionExcluders = false;
      List<Selector> tmpSelectorGroup = new ArrayList<Selector>();
      for (Selector curSelector : selectorGroup) {
        if (curSelector.isIncluder()) {
          if (curSelector.isApplyToAtomicDataset()) anyAtomicIncluders = true;
          if (curSelector.isApplyToCollectionDataset()) anyCollectionIncluders = true;
        } else { // curSelector.isExcluder()
          if (curSelector.isApplyToAtomicDataset()) anyAtomicExcluders = true;
          if (curSelector.isApplyToCollectionDataset()) anyCollectionExcluders = true;
        }
        tmpSelectorGroup.add(curSelector);
      }

      this.selectorGroup = tmpSelectorGroup;
      this.containsAtomicIncluders = anyAtomicIncluders;
      this.containsAtomicExcluders = anyAtomicExcluders;
      this.containsCollectionIncluders = anyCollectionIncluders;
      this.containsCollectionExcluders = anyCollectionExcluders;
    }
  }
コード例 #2
0
  public DatasetScanFilter(Selector selector) {
    if (selector == null) {
      this.selectorGroup = Collections.emptyList();
      this.containsAtomicIncluders = false;
      this.containsAtomicExcluders = false;
      this.containsCollectionIncluders = false;
      this.containsCollectionExcluders = false;
    } else {
      boolean anyAtomicIncluders = false;
      boolean anyAtomicExcluders = false;
      boolean anyCollectionIncluders = false;
      boolean anyCollectionExcluders = false;

      if (selector.isIncluder()) {
        if (selector.isApplyToAtomicDataset()) anyAtomicIncluders = true;
        if (selector.isApplyToCollectionDataset()) anyCollectionIncluders = true;
      } else { // curSelector.isExcluder()
        if (selector.isApplyToAtomicDataset()) anyAtomicExcluders = true;
        if (selector.isApplyToCollectionDataset()) anyCollectionExcluders = true;
      }

      this.selectorGroup = Collections.singletonList(selector);
      this.containsAtomicIncluders = anyAtomicIncluders;
      this.containsAtomicExcluders = anyAtomicExcluders;
      this.containsCollectionIncluders = anyCollectionIncluders;
      this.containsCollectionExcluders = anyCollectionExcluders;
    }
  }