本文整理汇总了Java中org.apache.uima.cas.ShortArrayFS类的典型用法代码示例。如果您正苦于以下问题:Java ShortArrayFS类的具体用法?Java ShortArrayFS怎么用?Java ShortArrayFS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShortArrayFS类属于org.apache.uima.cas包,在下文中一共展示了ShortArrayFS类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FsCopiers
import org.apache.uima.cas.ShortArrayFS; //导入依赖的package包/类
/**
* Convenience constructor which only needs the callback for encountered feature structures.
*
* @param featureStructureEncounteredCallback callback for encountered feature structures
*/
FsCopiers(UnaryOperator<FeatureStructure> featureStructureEncounteredCallback,
FeatureCopiers featureCopiers) {
this.featureCopiers = featureCopiers;
this.featureStructureEncounteredCallback = featureStructureEncounteredCallback;
fsCopiers = new HashMap<>();
fsCopiers.put(CAS.TYPE_NAME_BOOLEAN_ARRAY, copyArray(BooleanArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_BYTE_ARRAY, copyArray(ByteArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_DOUBLE_ARRAY, copyArray(DoubleArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_FLOAT_ARRAY, copyArray(FloatArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_FS_ARRAY, this::copyFsArray);
fsCopiers.put(CAS.TYPE_NAME_LONG_ARRAY, copyArray(LongArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_INTEGER_ARRAY, copyArray(IntArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_SHORT_ARRAY, copyArray(ShortArrayFS.class));
fsCopiers.put(CAS.TYPE_NAME_STRING_ARRAY, copyArray(StringArrayFS.class));
}
示例2: setArrayValue
import org.apache.uima.cas.ShortArrayFS; //导入依赖的package包/类
public static void setArrayValue(CommonArrayFS array, int index, Object value) {
String name = array.getType().getName();
if (CAS.TYPE_NAME_BOOLEAN_ARRAY.equals(name))
((BooleanArrayFS)array).set(index, (Boolean) value);
else if (CAS.TYPE_NAME_BYTE_ARRAY.equals(name))
((ByteArrayFS)array).set(index, (Byte) value);
else if (CAS.TYPE_NAME_DOUBLE_ARRAY.equals(name))
((DoubleArrayFS)array).set(index, (Double) value);
else if (CAS.TYPE_NAME_FLOAT_ARRAY.equals(name))
((FloatArrayFS)array).set(index, (Float) value);
else if (CAS.TYPE_NAME_INTEGER_ARRAY.equals(name))
((IntArrayFS)array).set(index, (Integer) value);
else if (CAS.TYPE_NAME_LONG_ARRAY.equals(name))
((LongArrayFS)array).set(index, (Long) value);
else if (CAS.TYPE_NAME_SHORT_ARRAY.equals(name))
((ShortArrayFS)array).set(index, (Short) value);
else if (CAS.TYPE_NAME_STRING_ARRAY.equals(name))
((StringArrayFS)array).set(index, (String) value);
else
((ArrayFS)array).set(index, (FeatureStructure) value);
}