本文整理汇总了Java中org.apache.uima.cas.Type.isArray方法的典型用法代码示例。如果您正苦于以下问题:Java Type.isArray方法的具体用法?Java Type.isArray怎么用?Java Type.isArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.uima.cas.Type
的用法示例。
在下文中一共展示了Type.isArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isValidPath
import org.apache.uima.cas.Type; //导入方法依赖的package包/类
public static boolean isValidPath(Type type, String path, JCas view) {
String[] pathMembers = path.split("/");
Type pathMemberType = type; // will be set to type of last path member
// feature type
for (String pathMember : pathMembers) {
Feature feature = pathMemberType.getFeatureByBaseName(pathMember);
if (feature == null) {
return false;
}
pathMemberType = feature.getRange();
if (pathMemberType.isArray())
pathMemberType = pathMemberType.getComponentType();
}
return isValidType(pathMemberType, view.getTypeSystem());
}
示例2: getPrimitiveArrayFeatureValue
import org.apache.uima.cas.Type; //导入方法依赖的package包/类
private static Object[] getPrimitiveArrayFeatureValue(
JCas view,
FeatureStructure featureStructure,
Feature feature) throws CleartkExtractorException {
TypeSystem typeSystem = view.getTypeSystem();
Type type = feature.getRange();
if (type.isArray()) {
Type componentType = type.getComponentType();
FeatureStructure featureValue = featureStructure.getFeatureValue(feature);
if (componentType.equals(typeSystem.getType("uima.cas.String"))) {
return ((StringArray) featureValue).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Boolean"))) {
return Arrays.asList(((BooleanArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Double"))) {
return Arrays.asList(((DoubleArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Float"))) {
return Arrays.asList(((FloatArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Byte"))) {
return Arrays.asList(((ByteArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Short"))) {
return Arrays.asList(((ShortArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Integer"))) {
return Arrays.asList(((IntegerArray) featureValue).toArray()).toArray();
} else if (componentType.equals(typeSystem.getType("uima.cas.Long"))) {
return Arrays.asList(((LongArray) featureValue).toArray()).toArray();
}
} else
throw CleartkExtractorException.notPrimitiveArray(feature);
return null;
}
示例3: isCollectionType
import org.apache.uima.cas.Type; //导入方法依赖的package包/类
public static boolean isCollectionType(Type type) {
// TODO what about FSList ?
return type.isArray();
}