Examples of FeatureStructure


Examples of org.apache.uima.cas.FeatureStructure

      return featureValue.getFeature().getShortName();
    }
    else if (element instanceof IAdaptable) {

      FeatureStructure structure = null;

      if (((IAdaptable) element).getAdapter(AnnotationFS.class) != null) {
        structure = (AnnotationFS) ((IAdaptable) element)
                .getAdapter(AnnotationFS.class);
      }

      if (structure == null) {
        structure = (FeatureStructure) ((IAdaptable) element).getAdapter(FeatureStructure.class);
      }

      return structure.getType().getShortName() + " (id=" +
          ((FeatureStructureImpl) structure).getAddress() + ")";
    }
    else {
      assert false : "Unexpected element!";
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

      if (featureValue.getFeature().getRange().isPrimitive()) {
        cell.setText(featureValue.getFeatureStructure().getFeatureValueAsString(
                featureValue.getFeature()));
      }
      else {
        FeatureStructure value = (FeatureStructure) featureValue.getValue();

        if (value == null) {
          cell.setText("null");
        } else {
          cell.setText("[" + value.getType().getShortName() + "]");
        }
      }
    }
    else if (element instanceof ArrayValue) {

      ArrayValue value = (ArrayValue) element;

      // if primitive array
      if (value.getFeatureStructure() instanceof CommonArrayFS ||
              value.getFeatureStructure() instanceof StringArrayFS) {
        cell.setText(value.get().toString());
      }
      else if (value.getFeatureStructure() instanceof ArrayFS) {
        ArrayFS array = (ArrayFS) value.getFeatureStructure();

        FeatureStructure fs = array.get(value.slot());

        if (fs == null) {
          cell.setText("null");
        }
        else {
          cell.setText("[" + fs.getType().getShortName() + "]");
        }
      }
      else {
        throw new TaeError("Unexpected array type!");
      }
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

              // this can fail
              FeatureValue value = (FeatureValue) tableItem.getData();

              Type range = value.getFeature().getRange();

              FeatureStructure dragFeatureStructure = (FeatureStructure) event.data;

              if (range.equals(dragFeatureStructure.getType())) {

                FeatureStructure target = value.getFeatureStructure();

                target.setFeatureValue(value.getFeature(), dragFeatureStructure);

                document.update(target);

                event.detail = DND.DROP_COPY;
              }
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

      }
      else if (element instanceof ArrayValue) {

        ArrayValue value = (ArrayValue) element;

        FeatureStructure arrayFS = value.getFeatureStructure();

        if (arrayFS instanceof ArrayFS) {
          return false;
        }
        else if (arrayFS instanceof CommonArrayFS ||
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

        }
      } else if (element instanceof ArrayValue) {

        ArrayValue arrayValue = (ArrayValue) element;

        FeatureStructure arrayFS = arrayValue.getFeatureStructure();

        CellEditor editor;

        if (arrayFS instanceof BooleanArrayFS) {
          editor = new ComboBoxCellEditor(viewer.getTree(), new String[]{"false", "true"},
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

        return array.get(slot());
      }
    }

    if (AnnotationFS.class.equals(adapter)) {
      FeatureStructure fs = (FeatureStructure) getAdapter(FeatureStructure.class);

      if (fs instanceof AnnotationFS) {
        return fs;
      }
    }
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

  public Object[] getElements(Object inputElement) {

    if (inputElement != null) {

      FeatureStructure featureStructure = (FeatureStructure) inputElement;

      Type type = featureStructure.getType();

      if (!type.isArray()) {
        List featureTypes = type.getFeatures();

        Collection<FeatureValue> featureValues = new LinkedList<FeatureValue>();
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

    if (parentElement instanceof FeatureValue) {
      FeatureValue value = (FeatureValue) parentElement;

      if (!value.getFeature().getRange().isArray()) {
        FeatureStructure childStructure = (FeatureStructure) value.getValue();
        return getElements(childStructure);
      } else {
        FeatureStructure arrayFS = value.getFeatureStructure().getFeatureValue(value.getFeature());

        return getElements(arrayFS);
      }
    } else if (parentElement instanceof ArrayValue) {
      ArrayValue value = (ArrayValue) parentElement;
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

  public FeatureStructure next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }

    FeatureStructure result = mNext;
    mNext = null;

    return result;
  }
View Full Code Here

Examples of org.apache.uima.cas.FeatureStructure

    mAnnotations = new ArrayList<AnnotationFS>(selection.size());

    for (Iterator<FeatureStructure> it = new FeatureStructureSelectionIterator(selection);
        it.hasNext();) {
      FeatureStructure structure = it.next();

      if (structure instanceof AnnotationFS) {
        mAnnotations.add((AnnotationFS) structure);
      }
    }
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.