public double getDoubleValue(String name) { return featureStructure.getDoubleValue(getFeature(name)); }
private Object getPrimitive(FeatureStructure fs, Feature feature) { String s = feature.getRange().getName(); if (s.equals("uima.cas.String")) return fs.getStringValue(feature); else if (s.equals("uima.cas.Integer")) return fs.getIntValue(feature); else if (s.equals("uima.cas.Double")) return fs.getDoubleValue(feature); return null; }
result = structure.getFloatValue(feature); } else if (Double.class.equals(primitiveClass)) { result = structure.getDoubleValue(feature); } else if (String.class.equals(primitiveClass)) { result = structure.getStringValue(feature);
private static void fillFeatures(DebugNameValuePair[] result, int startOffset, FeatureStructure fs, List<Feature> features) { int nbrFeats = features.size(); int i = startOffset; for (int j = 0; j < nbrFeats; j++) { Feature feat = features.get(j); DebugNameValuePair nv = new DebugNameValuePair(feat.getShortName(), null); String rangeTypeName = feat.getRange().getName(); if ("uima.cas.Integer".equals(rangeTypeName)) nv.setValue(Integer.valueOf(fs.getIntValue(feat))); else if ("uima.cas.Float".equals(rangeTypeName)) nv.setValue(Float.valueOf(fs.getFloatValue(feat))); else if ("uima.cas.Boolean".equals(rangeTypeName)) nv.setValue(Boolean.valueOf(fs.getBooleanValue(feat))); else if ("uima.cas.Byte".equals(rangeTypeName)) nv.setValue(Byte.valueOf(fs.getByteValue(feat))); else if ("uima.cas.Short".equals(rangeTypeName)) nv.setValue(Short.valueOf(fs.getShortValue(feat))); else if ("uima.cas.Long".equals(rangeTypeName)) nv.setValue(Long.valueOf(fs.getLongValue(feat))); else if ("uima.cas.Double".equals(rangeTypeName)) nv.setValue(Double.valueOf(fs.getDoubleValue(feat))); else if ("uima.cas.String".equals(rangeTypeName)) nv.setValue(fs.getStringValue(feat)); else nv.setValue(fs.getFeatureValue(feat)); result[i++] = nv; } }
break; case CAS.TYPE_NAME_DOUBLE: generator.writeNumber(annotation.getDoubleValue(feature)); break; default:
return featureStructure.getBooleanValue(feature); else if (type.equals(typeSystem.getType("uima.cas.Double"))) return featureStructure.getDoubleValue(feature); else if (type.equals(typeSystem.getType("uima.cas.Float"))) return featureStructure.getFloatValue(feature);
break; case LowLevelCAS.TYPE_CLASS_DOUBLE: featurePathValue = Double.toString(currentFS.getDoubleValue(feature)); noFurtherElementsPossible = true; break;
private Number getNumberValue(MatchContext context, RutaStream stream) { AnnotationFS annotation = context.getAnnotation(); Number result = null; List<AnnotationFS> list = this.getTargetAnnotation(annotation, this.fe, context, stream); Collection<? extends FeatureStructure> featureStructures = this.fe.getFeatureStructures(list, false, context, stream); if (!featureStructures.isEmpty()) { Feature feature = this.fe.getFeature(context, stream); Type range = feature.getRange(); FeatureStructure next = featureStructures.iterator().next(); if (next instanceof AnnotationFS && !next.getType().equals(annotation.getType())) { feature = this.fe.getFeature(new MatchContext((AnnotationFS) next, context.getElement(), context.getRuleMatch(), context.getDirection()), stream); } if (CAS.TYPE_NAME_BYTE.equals(range.getName())) { result = next.getByteValue(feature); } else if (CAS.TYPE_NAME_DOUBLE.equals(range.getName())) { result = next.getDoubleValue(feature); } else if (CAS.TYPE_NAME_FLOAT.equals(range.getName())) { result = next.getFloatValue(feature); } else if (CAS.TYPE_NAME_INTEGER.equals(range.getName())) { result = next.getIntValue(feature); } else if (CAS.TYPE_NAME_LONG.equals(range.getName())) { result = next.getLongValue(feature); } else if (CAS.TYPE_NAME_SHORT.equals(range.getName())) { result = next.getShortValue(feature); } } return result; }
break; case LowLevelCAS.TYPE_CLASS_DOUBLE: featurePathValue = Double.toString(currentFS.getDoubleValue(feature)); noFurtherElementsPossible = true; break;
case LowLevelCAS.TYPE_CLASS_DOUBLE: featurePathValue = Double.toString(currentFS .getDoubleValue(feature)); noFurtherElementsPossible = true; break;
ps.setFloat(argIdx, anno.getFloatValue(feat)); } else if ("uima.cas.Double".equals(feat.getRange().getName())) { ps.setDouble(argIdx, anno.getDoubleValue(feat)); } else if ("uima.cas.Byte".equals(feat.getRange().getName())) { ps.setByte(argIdx, anno.getByteValue(feat));
ps.setFloat(argIdx, anno.getFloatValue(feat)); } else if ("uima.cas.Double".equals(feat.getRange().getName())) { ps.setDouble(argIdx, anno.getDoubleValue(feat)); } else if ("uima.cas.Byte".equals(feat.getRange().getName())) { ps.setByte(argIdx, anno.getByteValue(feat));
newFs.addFeature(new Feature<Integer>(fName, (int) fVal)); } else if (casF.getRange().getName().equals("uima.cas.Double")) { double fVal = casFs.getDoubleValue(casF); newFs.addFeature(new Feature<Double>(fName, fVal)); } else if (casF.getRange().getName().equals("uima.cas.Float")) {
if (!(fsNew.getDoubleValue(feature) == fsOld.getDoubleValue(olFeature))) {
Double v1 = fs.getDoubleValue(feature); if (getArg() instanceof INumberExpression) { INumberExpression expr = (INumberExpression) getArg();
/** * Get the feature value of this {@code Feature} on this annotation */ private static Object getFeatureValue(FeatureStructure aFS, Feature aFeature) { switch (aFeature.getRange().getName()) { case CAS.TYPE_NAME_STRING: return aFS.getFeatureValueAsString(aFeature); case CAS.TYPE_NAME_BOOLEAN: return aFS.getBooleanValue(aFeature); case CAS.TYPE_NAME_FLOAT: return aFS.getFloatValue(aFeature); case CAS.TYPE_NAME_INTEGER: return aFS.getIntValue(aFeature); case CAS.TYPE_NAME_BYTE: return aFS.getByteValue(aFeature); case CAS.TYPE_NAME_DOUBLE: return aFS.getDoubleValue(aFeature); case CAS.TYPE_NAME_LONG: aFS.getLongValue(aFeature); case CAS.TYPE_NAME_SHORT: aFS.getShortValue(aFeature); default: return null; // return aFS.getFeatureValue(aFeature); } }
/** * Get the feature value of this {@code Feature} on this annotation */ private static Object getFeatureValue(FeatureStructure aFS, Feature aFeature) { switch (aFeature.getRange().getName()) { case CAS.TYPE_NAME_STRING: return aFS.getFeatureValueAsString(aFeature); case CAS.TYPE_NAME_BOOLEAN: return aFS.getBooleanValue(aFeature); case CAS.TYPE_NAME_FLOAT: return aFS.getFloatValue(aFeature); case CAS.TYPE_NAME_INTEGER: return aFS.getIntValue(aFeature); case CAS.TYPE_NAME_BYTE: return aFS.getByteValue(aFeature); case CAS.TYPE_NAME_DOUBLE: return aFS.getDoubleValue(aFeature); case CAS.TYPE_NAME_LONG: aFS.getLongValue(aFeature); case CAS.TYPE_NAME_SHORT: aFS.getShortValue(aFeature); default: return null; // return aFS.getFeatureValue(aFeature); } }
break; case LowLevelCAS.TYPE_CLASS_DOUBLE: checkCondidtion = checkDouble(currentFS.getDoubleValue(feature), condition); noFurtherElementsPossible = true; break;
break; case LowLevelCAS.TYPE_CLASS_DOUBLE: checkCondidtion = checkDouble(currentFS.getDoubleValue(feature), condition); noFurtherElementsPossible = true; break;
if (aFS1.getDoubleValue(f1) != aFS2.getDoubleValue(f2)) { return false;