Package org.apache.uima.cas

Examples of org.apache.uima.cas.ArrayFS.toArray()


    // From CAS array to Java array.
    FeatureStructure fs1 = this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_ANNOTATION));
    FeatureStructure fs2 = this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_TOP));
    FeatureStructure fs3 = this.cas.createFS(this.ts.getType(CASTestSetup.TOKEN_TYPE));
    ArrayFS array = this.cas.createArrayFS(3);
    FeatureStructure[] fsArray = array.toArray();
    for (int i = 0; i < 3; i++) {
      assertTrue(fsArray[i] == null);
    }
    array.set(0, fs1);
    array.set(1, fs2);
View Full Code Here


      assertTrue(fsArray[i] == null);
    }
    array.set(0, fs1);
    array.set(1, fs2);
    array.set(2, fs3);
    fsArray = array.toArray();
    assertTrue(fsArray.length == 3);
    assertTrue(fsArray[0].equals(fs1));
    assertTrue(fsArray[1].equals(fs2));
    assertTrue(fsArray[2].equals(fs3));
View Full Code Here

    matched = baseFS.getBooleanValue(baseFeat);

    f = fs.getType().getFeatureByBaseName(ExplainConstants.CONDITIONS);
    ArrayFS value = (ArrayFS) fs.getFeatureValue(f);
    if (value != null) {
      FeatureStructure[] fsarray = value.toArray();
      for (FeatureStructure each : fsarray) {
        Feature eachFeat = each.getType().getFeatureByBaseName(ExplainConstants.VALUE);
        boolean eachValue = each.getBooleanValue(eachFeat);
        matched &= eachValue;
      }
View Full Code Here

      processBlockRuleApply(fs, blockNode, ts, offset, onlyRules);
    }
    Feature feature = blockApplyType.getFeatureByBaseName(ExplainConstants.INNER_APPLY);
    FeatureStructure featureValue = fs.getFeatureValue(feature);
    ArrayFS value = (ArrayFS) featureValue;
    FeatureStructure[] fsarray = value.toArray();
    for (FeatureStructure each : fsarray) {
      if (!onlyRules) {
        buildTree(each, blockNode, ts, offset, onlyRules);
      } else {
        buildTree(each, parent, ts, offset, onlyRules);
View Full Code Here

    Feature feature = ruleApplyType.getFeatureByBaseName(ExplainConstants.RULES);
    ArrayFS value = (ArrayFS) fs.getFeatureValue(feature);
    if (value == null)
      return;
    FeatureStructure[] fsarray = value.toArray();

    MatchedRootNode matched = new MatchedRootNode(ruleNode, ts);
    FailedRootNode failed = new FailedRootNode(ruleNode, ts);
    ruleNode.addChild(matched);
    ruleNode.addChild(failed);
View Full Code Here

      Feature df = eachRuleMatch.getType().getFeatureByBaseName(ExplainConstants.DELEGATES);
      if (df != null) {
        ArrayFS dv = (ArrayFS) eachRuleMatch.getFeatureValue(df);
        if (dv != null) {
          FeatureStructure[] da = dv.toArray();
          for (FeatureStructure delegateFS : da) {
            buildTree(delegateFS, ruleNode, ts, offset, onlyRules);
          }
        }
      }
View Full Code Here

    RuleApplyNode ruleNode = new RuleApplyNode(parent, fs, ts);
    parent.addChild(ruleNode);

    Feature feature = ruleApplyType.getFeatureByBaseName(ExplainConstants.RULES);
    ArrayFS value = (ArrayFS) fs.getFeatureValue(feature);
    FeatureStructure[] fsarray = value.toArray();

    MatchedRootNode matched = new MatchedRootNode(ruleNode, ts);
    FailedRootNode failed = new FailedRootNode(ruleNode, ts);
    ruleNode.addChild(matched);
    ruleNode.addChild(failed);
View Full Code Here

      Feature df = eachRuleMatch.getType().getFeatureByBaseName(ExplainConstants.DELEGATES);
      if (df != null) {
        ArrayFS dv = (ArrayFS) eachRuleMatch.getFeatureValue(df);
        if (dv != null) {
          FeatureStructure[] da = dv.toArray();
          for (FeatureStructure delegateFS : da) {
            buildTree(delegateFS, ruleNode, ts, offset, onlyRules);
          }
        }
      }
View Full Code Here

    matchNode.addChild(remRoot);

    Feature feature = ruleMatchType.getFeatureByBaseName(ExplainConstants.ELEMENTS);
    ArrayFS value = (ArrayFS) fs.getFeatureValue(feature);
    if (value != null) {
      FeatureStructure[] fsarray = value.toArray();
      for (FeatureStructure each : fsarray) {
        buildTree(each, remRoot, ts, offset, onlyRules);
      }
    }
  }
View Full Code Here

    RuleElementMatchesNode remsNode = new RuleElementMatchesNode(parent, fs, ts);
    parent.addChild(remsNode);

    Feature feature = ruleElementMatchesType.getFeatureByBaseName(ExplainConstants.MATCHES);
    ArrayFS value = (ArrayFS) fs.getFeatureValue(feature);
    FeatureStructure[] fsarray = value.toArray();
    for (FeatureStructure each : fsarray) {
      buildTree(each, remsNode, ts, offset, onlyRules);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.