本文整理匯總了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();
}