Examples of ArrayValue


Examples of org.apache.uima.caseditor.editor.ArrayValue

      else {
        return hasChildren((FeatureStructure) value.getValue());
      }
    } else if (element instanceof ArrayValue) {

      ArrayValue value = (ArrayValue) element;

      if (value.getFeatureStructure() instanceof ArrayFS) {

        ArrayFS array = (ArrayFS) value.getFeatureStructure();

        return hasChildren(array.get(value.slot()));
      }
      else {
        // false for primitive arrays
        return false;
      }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

      cell.setText(featureValue.getFeature().getShortName());

    }
    else if (element instanceof ArrayValue) {
      ArrayValue arrayValue = (ArrayValue) cell.getElement();

      cell.setText(Integer.toString(arrayValue.slot()));
    }
    else {
      throw new TaeError("Unkown element!");
    }
  }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

              getBooleanValue(featureValue.getFeature()));
        }

      }
      else if (element instanceof ArrayValue) {
          ArrayValue value = (ArrayValue) element;

          // if not a boolean array return string value
          if (!(value.getFeatureStructure() instanceof BooleanArrayFS)) {
            return value.get().toString();
          }
          else {
            return booleanToInt((Boolean) value.get());
          }
      }
      else {
        throw new TaeError("Unkown element type!");
      }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

          viewer.update(element, null);

        } else if (element instanceof ArrayValue) {

          ArrayValue arrayValue = (ArrayValue) element;

          if (!(arrayValue.getFeatureStructure() instanceof BooleanArrayFS)) {
            arrayValue.set((String) value);
          }
          else {
            arrayValue.set(Boolean.toString(
                    intToBoolean((Integer) value)).toString());
          }

          document.update(arrayValue.getFeatureStructure());

        } else {
          throw new TaeError("Unkown element type");
        }
      }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

          featureValue.getFeatureStructure().setFeatureValue(featureValue.getFeature(), null);

          document.update(featureValue.getFeatureStructure());
        }
      } else if (element instanceof ArrayValue) {
          ArrayValue arrayValue = (ArrayValue) element;

          ArrayFS array = (ArrayFS) arrayValue.getFeatureStructure();

          array.set(arrayValue.slot(), null);

          document.update(array);
      }
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

          result = !featureValue.getFeature().getRange().isPrimitive() &&
              featureValue.getFeatureStructure().getFeatureValue(featureValue.getFeature()) != null;
        }
        else if (selection.getFirstElement() instanceof ArrayValue) {
          ArrayValue arrayValue = (ArrayValue) selection.getFirstElement();

            if (arrayValue.getFeatureStructure() instanceof ArrayFS) {
              ArrayFS array = (ArrayFS) arrayValue.getFeatureStructure();

              result = array.get(arrayValue.slot()) != null;
            }
        }
      }

      return result;
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

        featureValue.getFeatureStructure().setFeatureValue(featureValue.getFeature(), newValue);
        document.update(featureValue.getFeatureStructure());
      }
      else if (selection.getFirstElement() instanceof ArrayValue) {
        ArrayValue value = (ArrayValue) selection.getFirstElement();


        TypeSystem typeSystem = document.getCAS().getTypeSystem();

        CreateFeatureStructureDialog createFsDialog =
          new CreateFeatureStructureDialog(Display.getCurrent()
                  .getActiveShell(), typeSystem.getType(CAS.TYPE_NAME_TOP),
                  typeSystem);

        int returnCode = createFsDialog.open();

        if (returnCode == IDialogConstants.OK_ID) {

          FeatureStructure fs = createFS(createFsDialog.getType(), createFsDialog.getArraySize());

          ArrayFS array = (ArrayFS) value.getFeatureStructure();

          array.set(value.slot(), fs);

          document.update(value.getFeatureStructure());
        }
      }
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

          result = !featureValue.getFeature().getRange().isPrimitive() &&
              featureValue.getFeatureStructure().getFeatureValue(featureValue.getFeature()) == null;
        }
        else if (selection.getFirstElement() instanceof ArrayValue) {
          ArrayValue value = (ArrayValue) selection.getFirstElement();

          if (value.getFeatureStructure() instanceof ArrayFS) {
            ArrayFS array = (ArrayFS) value.getFeatureStructure();

            if (array.get(value.slot()) == null) {
              result = true;
            }
          }
        }
      }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

        featureValue.getFeatureStructure().setFeatureValue(featureValue.getFeature(), newValue);
        document.update(featureValue.getFeatureStructure());
      }
      else if (selection.getFirstElement() instanceof ArrayValue) {
        ArrayValue value = (ArrayValue) selection.getFirstElement();


        TypeSystem typeSystem = document.getCAS().getTypeSystem();

        CreateFeatureStructureDialog createFsDialog =
          new CreateFeatureStructureDialog(Display.getCurrent()
                  .getActiveShell(), typeSystem.getType(CAS.TYPE_NAME_TOP),
                  typeSystem);

        int returnCode = createFsDialog.open();

        if (returnCode == IDialogConstants.OK_ID) {

          FeatureStructure fs = createFS(createFsDialog.getType(), createFsDialog.getArraySize());

          ArrayFS array = (ArrayFS) value.getFeatureStructure();

          array.set(value.slot(), fs);

          document.update(value.getFeatureStructure());
        }
      }
    }
View Full Code Here

Examples of org.apache.uima.caseditor.editor.ArrayValue

          result = !featureValue.getFeature().getRange().isPrimitive() &&
              featureValue.getFeatureStructure().getFeatureValue(featureValue.getFeature()) == null;
        }
        else if (selection.getFirstElement() instanceof ArrayValue) {
          ArrayValue value = (ArrayValue) selection.getFirstElement();

          if (value.getFeatureStructure() instanceof ArrayFS) {
            ArrayFS array = (ArrayFS) value.getFeatureStructure();

            if (array.get(value.slot()) == null) {
              result = true;
            }
          }
        }
      }
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.