本文整理汇总了Java中org.apache.uima.cas.FeatureStructure.getLongValue方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureStructure.getLongValue方法的具体用法?Java FeatureStructure.getLongValue怎么用?Java FeatureStructure.getLongValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.uima.cas.FeatureStructure
的用法示例。
在下文中一共展示了FeatureStructure.getLongValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFeatureValue
import org.apache.uima.cas.FeatureStructure; //导入方法依赖的package包/类
/**
* Get the feature value of this {@code Feature} on this annotation
*/
public 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);
}
}
示例2: getPrimitiveFeatureValue
import org.apache.uima.cas.FeatureStructure; //导入方法依赖的package包/类
/**
* see section 4.2.1 of the UIMA References documentation.
*
* @param view
* @param featureStructure
* @param feature
* @return The feature value.
*/
private static Object getPrimitiveFeatureValue(
JCas view,
FeatureStructure featureStructure,
Feature feature) throws CleartkExtractorException {
TypeSystem typeSystem = view.getTypeSystem();
Type type = feature.getRange();
if (type.equals(typeSystem.getType("uima.cas.Boolean")))
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);
else if (type.equals(typeSystem.getType("uima.cas.Byte")))
return featureStructure.getByteValue(feature);
else if (type.equals(typeSystem.getType("uima.cas.Short")))
return featureStructure.getShortValue(feature);
else if (type.equals(typeSystem.getType("uima.cas.Integer")))
return featureStructure.getIntValue(feature);
else if (type.equals(typeSystem.getType("uima.cas.Long")))
return featureStructure.getLongValue(feature);
else if (type.equals(typeSystem.getType("uima.cas.String")))
return featureStructure.getStringValue(feature);
else
throw CleartkExtractorException.notPrimitive(feature);
}