Package org.apache.uima.fit.util
Class FSCollectionFactory
java.lang.Object
org.apache.uima.fit.util.FSCollectionFactory
Bridge between Java
Collections from different representations of collections
of UIMA FeatureStructures.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends FeatureStructure>
List<T>Convert anArrayFSto aCollection.static <T extends FeatureStructure>
List<T>Fetch all annotations of the given type or its sub-types from the given FS array.Fetch all annotations of the given type or its sub-types from the given FS array.static List<FeatureStructure>Deprecated.static <T extends FeatureStructure>
Collection<T>create(FSIterator<T> aIterator) Convert anFSIteratorto aCollection.static <T extends AnnotationFS>
List<T>create(AnnotationIndex<T> aIndex) Deprecated.Useindex.select().asList()static <T extends TOP>
Collection<T>static <T extends TOP>
Collection<T>Fetch all annotations of the given type or its sub-types from the given FS list.create(IntegerList aList) create(StringList aList) static <T extends FeatureStructure>
ArrayFS<T>createArrayFS(CAS aCas, Collection<T> aCollection) static <T extends FeatureStructure>
ArrayFS<T>createArrayFS(CAS aCas, T... aArray) static BooleanArraycreateBooleanArray(JCas aJCas, boolean... aArray) static BooleanArraycreateBooleanArray(JCas aJCas, Collection<Boolean> aCollection) static BooleanArrayFScreateBooleanArrayFS(CAS aCas, boolean... aArray) static BooleanArrayFScreateBooleanArrayFS(CAS aCas, Collection<Boolean> aCollection) static ByteArraycreateByteArray(JCas aJCas, byte... aArray) static ByteArraycreateByteArray(JCas aJCas, Collection<Byte> aCollection) static ByteArrayFScreateByteArrayFS(CAS aCas, byte... aArray) static ByteArrayFScreateByteArrayFS(CAS aCas, Collection<Byte> aCollection) static DoubleArraycreateDoubleArray(JCas aJCas, double... aArray) static DoubleArraycreateDoubleArray(JCas aJCas, Collection<Double> aCollection) static DoubleArrayFScreateDoubleArrayFS(CAS aCas, double... aArray) static DoubleArrayFScreateDoubleArrayFS(CAS aCas, Collection<Double> aCollection) static FloatArraycreateFloatArray(JCas aJCas, float... aArray) static FloatArraycreateFloatArray(JCas aJCas, Collection<Float> aCollection) static FloatArrayFScreateFloatArrayFS(CAS aCas, float... aArray) static FloatArrayFScreateFloatArrayFS(CAS aCas, Collection<Float> aCollection) static <T extends FeatureStructure>
TcreateFloatList(CAS aCas, float... aValues) static <T extends FeatureStructure>
TcreateFloatList(CAS aCas, Collection<Float> aValues) static FloatListcreateFloatList(JCas aJCas, float... aValues) static FloatListcreateFloatList(JCas aJCas, Collection<Float> aCollection) static <T extends FeatureStructure>
FSArray<T>createFSArray(JCas aJCas, Collection<T> aCollection) static <T extends FeatureStructure>
FSArray<T>createFSArray(JCas aJCas, T... aArray) createFSList(CAS aCas, Collection<T> aValues) createFSList(CAS aCas, T... aValues) createFSList(JCas aJCas, Collection<T> aCollection) static IntegerArraycreateIntArray(JCas aJCas, int... aArray) static IntegerArraycreateIntArray(JCas aJCas, Collection<Integer> aCollection) static IntArrayFScreateIntArrayFS(CAS aCas, int... aArray) static IntArrayFScreateIntArrayFS(CAS aCas, Collection<Integer> aCollection) static <T extends FeatureStructure>
TcreateIntegerList(CAS aCas, int... aValues) static <T extends FeatureStructure>
TcreateIntegerList(CAS aCas, Collection<Integer> aValues) static IntegerListcreateIntegerList(JCas aJCas, int... aValues) static IntegerListcreateIntegerList(JCas aJCas, Collection<Integer> aCollection) static LongArraycreateLongArray(JCas aJCas, long... aArray) static LongArraycreateLongArray(JCas aJCas, Collection<Long> aCollection) static LongArrayFScreateLongArrayFS(CAS aCas, long... aArray) static LongArrayFScreateLongArrayFS(CAS aCas, Collection<Long> aCollection) static ShortArraycreateShortArray(JCas aJCas, short... aArray) static ShortArraycreateShortArray(JCas aJCas, Collection<Short> aCollection) static ShortArrayFScreateShortArrayFS(CAS aCas, short... aArray) static ShortArrayFScreateShortArrayFS(CAS aCas, Collection<Short> aCollection) static StringArraycreateStringArray(JCas aJCas, String... aArray) static StringArraycreateStringArray(JCas aJCas, Collection<String> aCollection) static StringArrayFScreateStringArrayFS(CAS aCas, String... aArray) static StringArrayFScreateStringArrayFS(CAS aCas, Collection<String> aCollection) static <T extends FeatureStructure>
TcreateStringList(CAS aCas, String... aValues) static <T extends FeatureStructure>
TcreateStringList(CAS aCas, Collection<String> aValues) static StringListcreateStringList(JCas aJCas, String... aValues) static StringListcreateStringList(JCas aJCas, Collection<String> aCollection) static BooleanArrayfillArray(BooleanArray aArray, boolean... aValues) static BooleanArrayfillArray(BooleanArray aArray, Iterable<Boolean> aValues) static ByteArraystatic ByteArraystatic DoubleArrayfillArray(DoubleArray aArray, double... aValues) static DoubleArrayfillArray(DoubleArray aArray, Iterable<Double> aValues) static FloatArrayfillArray(FloatArray aArray, float... aValues) static FloatArrayfillArray(FloatArray aArray, Iterable<Float> aValues) static <T extends FeatureStructure>
FSArray<T>static <T extends FeatureStructure>
FSArray<T>fillArray(FSArray<T> aArray, FeatureStructure... aValues) static IntegerArrayfillArray(IntegerArray aArray, int... aValues) static IntegerArrayfillArray(IntegerArray aArray, Iterable<Integer> aValues) static LongArraystatic LongArraystatic ShortArrayfillArray(ShortArray aArray, short... aValues) static ShortArrayfillArray(ShortArray aArray, Iterable<Short> aValues) static StringArrayfillArray(StringArray aArray, Iterable<String> aValues) static StringArrayfillArray(StringArray aArray, String... aValues) static <T extends FeatureStructure>
ArrayFS<T>fillArrayFS(ArrayFS<T> aArrayFs, Iterable<? extends T> aCollection) static <T extends FeatureStructure>
ArrayFS<T>fillArrayFS(ArrayFS<T> aArrayFs, FeatureStructure... aArray) static BooleanArrayFSfillArrayFS(BooleanArrayFS aArrayFs, boolean... aValues) static BooleanArrayFSfillArrayFS(BooleanArrayFS aArrayFs, Iterable<Boolean> aValues) static ByteArrayFSfillArrayFS(ByteArrayFS aArrayFs, byte... aValues) static ByteArrayFSfillArrayFS(ByteArrayFS aArrayFs, Iterable<Byte> aValues) static DoubleArrayFSfillArrayFS(DoubleArrayFS aArrayFs, double... aValues) static DoubleArrayFSfillArrayFS(DoubleArrayFS aArrayFs, Iterable<Double> aValues) static FloatArrayFSfillArrayFS(FloatArrayFS aArrayFs, float... aValues) static FloatArrayFSfillArrayFS(FloatArrayFS aArrayFs, Iterable<Float> aValues) static IntArrayFSfillArrayFS(IntArrayFS aArrayFs, int... aValues) static IntArrayFSfillArrayFS(IntArrayFS aArrayFs, Iterable<Integer> aValues) static LongArrayFSfillArrayFS(LongArrayFS aArrayFs, long... aValues) static LongArrayFSfillArrayFS(LongArrayFS aArrayFs, Iterable<Long> aValues) static ShortArrayFSfillArrayFS(ShortArrayFS aArrayFs, short... aValues) static ShortArrayFSfillArrayFS(ShortArrayFS aArrayFs, Iterable<Short> aValues) static StringArrayFSfillArrayFS(StringArrayFS aArrayFs, Iterable<String> aValues) static StringArrayFSfillArrayFS(StringArrayFS aArrayFs, String... aValues)
-
Method Details
-
create
Deprecated.Usecas.select(type).asList()Create aCollectionof the given type of feature structures. This collection is backed by the CAS, either via anCAS.getAnnotationIndex(Type)orFSIndexRepository.getAllIndexedFS(Type).- Parameters:
cas- the CAS to select from.type- the type of feature structures to select. All sub-types are returned as well.- Returns:
- a
Collectionof the given type of feature structures backed live by the CAS. - See Also:
-
create
Convert anFSIteratorto aCollection.- Type Parameters:
T- the feature structure type- Parameters:
aIterator- the iterator to convert.- Returns:
- the wrapped iterator.
- See Also:
-
create
Deprecated.Useindex.select().asList()Convert anAnnotationIndexto aCollection.- Type Parameters:
T- the feature structure type- Parameters:
aIndex- the index to convert.- Returns:
- the wrapped index.
- See Also:
-
create
Convert anArrayFSto aCollection.- Parameters:
aArray- the array to convert.- Returns:
- a new collection containing the same feature structures as the provided array.
- See Also:
-
create
Fetch all annotations of the given type or its sub-types from the given FS array.- Type Parameters:
T- the JCas type.- Parameters:
aArray- the FS arrayaType- the JCas wrapper class.- Returns:
- a new collection of all feature structures of the given type.
-
create
Fetch all annotations of the given type or its sub-types from the given FS array.- Parameters:
aArray- the FS arrayaType- the CAS type.- Returns:
- a new collection of all feature structures of the given type.
-
createArrayFS
public static <T extends FeatureStructure> ArrayFS<T> createArrayFS(CAS aCas, Collection<T> aCollection) -
createArrayFS
-
createFSArray
public static <T extends FeatureStructure> FSArray<T> createFSArray(JCas aJCas, Collection<T> aCollection) -
createFSArray
-
createBooleanArrayFS
-
createBooleanArrayFS
-
createBooleanArray
-
createBooleanArray
-
createByteArrayFS
-
createByteArrayFS
-
createByteArray
-
createByteArray
-
createDoubleArrayFS
-
createDoubleArrayFS
-
createDoubleArray
-
createDoubleArray
-
createFloatArrayFS
-
createFloatArrayFS
-
createFloatArray
-
createFloatArray
-
createIntArrayFS
-
createIntArrayFS
-
createIntArray
-
createIntArray
-
createLongArrayFS
-
createLongArrayFS
-
createLongArray
-
createLongArray
-
createShortArrayFS
-
createShortArrayFS
-
createShortArray
-
createShortArray
-
createStringArrayFS
-
createStringArrayFS
-
createStringArray
-
createStringArray
-
fillArray
public static <T extends FeatureStructure> FSArray<T> fillArray(FSArray<T> aArray, Iterable<? extends T> aValues) -
fillArray
public static <T extends FeatureStructure> FSArray<T> fillArray(FSArray<T> aArray, FeatureStructure... aValues) -
fillArrayFS
public static <T extends FeatureStructure> ArrayFS<T> fillArrayFS(ArrayFS<T> aArrayFs, Iterable<? extends T> aCollection) -
fillArrayFS
public static <T extends FeatureStructure> ArrayFS<T> fillArrayFS(ArrayFS<T> aArrayFs, FeatureStructure... aArray) -
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
fillArray
-
fillArray
-
fillArrayFS
-
fillArrayFS
-
create
-
create
Fetch all annotations of the given type or its sub-types from the given FS list.- Type Parameters:
T- the JCas type.- Parameters:
aList- the FS listaType- the JCas wrapper class.- Returns:
- a new collection of all feature structures of the given type.
-
create
-
create
-
create
-
create
-
createFSList
-
createFSList
-
createFSList
-
createFloatList
-
createFloatList
-
createFloatList
-
createFloatList
-
createIntegerList
-
createIntegerList
-
createIntegerList
public static <T extends FeatureStructure> T createIntegerList(CAS aCas, Collection<Integer> aValues) -
createIntegerList
-
createStringList
-
createStringList
-
createStringList
-
createStringList
-
cas.select(type).asList()