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