public static <T> T getFeature(FeatureStructure aFS, String aFeature, Class<T> aClazz) { Feature feat = getMandatoryFeature(aFS, aFeature); return getFeature(aFS, feat, aClazz); }
public static void setFeature(FeatureStructure aFS, String aFeature, short... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setShortValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else { aFS.setFeatureValue(feat, createShortArray(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, byte... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setByteValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else { aFS.setFeatureValue(feat, createByteArray(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, long... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setLongValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else { aFS.setFeatureValue(feat, createLongArray(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, double... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setDoubleValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else { aFS.setFeatureValue(feat, createDoubleArray(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, boolean... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setBooleanValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else { aFS.setFeatureValue(feat, createBooleanArray(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, float... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setFloatValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else if (feat.getRange().isArray()) { aFS.setFeatureValue(feat, createFloatArray(aFS.getCAS(), aValue)); } else { aFS.setFeatureValue(feat, createFloatList(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, int... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setIntValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else if (feat.getRange().isArray()) { aFS.setFeatureValue(feat, createIntArray(aFS.getCAS(), aValue)); } else { aFS.setFeatureValue(feat, createIntegerList(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, String... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isPrimitive()) { requireSingleValue(feat, aValue); aFS.setStringValue(feat, aValue[0]); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else if (feat.getRange().isArray()) { aFS.setFeatureValue(feat, createStringArray(aFS.getCAS(), aValue)); } else { aFS.setFeatureValue(feat, createStringList(aFS.getCAS(), aValue)); } }
public static void setFeature(FeatureStructure aFS, String aFeature, FeatureStructure... aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (feat.getRange().isArray()) { aFS.setFeatureValue(feat, createArrayFS(aFS.getCAS(), aValue)); } else if (aValue == null) { aFS.setFeatureValue(feat, null); } else if (isListType(aFS.getCAS().getTypeSystem(), feat.getRange())) { aFS.setFeatureValue(feat, createFSList(aFS.getCAS(), aValue)); } else { requireSingleValue(feat, aValue); aFS.setFeatureValue(feat, aValue[0]); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void setFeature(FeatureStructure aFS, String aFeature, Collection aValue) { Feature feat = getMandatoryFeature(aFS, aFeature); if (aValue == null) { aFS.setFeatureValue(feat, null);