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 anArrayFS
to 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 anFSIterator
to 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 BooleanArray
createBooleanArray
(JCas aJCas, boolean... aArray) static BooleanArray
createBooleanArray
(JCas aJCas, Collection<Boolean> aCollection) static BooleanArrayFS
createBooleanArrayFS
(CAS aCas, boolean... aArray) static BooleanArrayFS
createBooleanArrayFS
(CAS aCas, Collection<Boolean> aCollection) static ByteArray
createByteArray
(JCas aJCas, byte... aArray) static ByteArray
createByteArray
(JCas aJCas, Collection<Byte> aCollection) static ByteArrayFS
createByteArrayFS
(CAS aCas, byte... aArray) static ByteArrayFS
createByteArrayFS
(CAS aCas, Collection<Byte> aCollection) static DoubleArray
createDoubleArray
(JCas aJCas, double... aArray) static DoubleArray
createDoubleArray
(JCas aJCas, Collection<Double> aCollection) static DoubleArrayFS
createDoubleArrayFS
(CAS aCas, double... aArray) static DoubleArrayFS
createDoubleArrayFS
(CAS aCas, Collection<Double> aCollection) static FloatArray
createFloatArray
(JCas aJCas, float... aArray) static FloatArray
createFloatArray
(JCas aJCas, Collection<Float> aCollection) static FloatArrayFS
createFloatArrayFS
(CAS aCas, float... aArray) static FloatArrayFS
createFloatArrayFS
(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 FloatList
createFloatList
(JCas aJCas, float... aValues) static FloatList
createFloatList
(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 IntegerArray
createIntArray
(JCas aJCas, int... aArray) static IntegerArray
createIntArray
(JCas aJCas, Collection<Integer> aCollection) static IntArrayFS
createIntArrayFS
(CAS aCas, int... aArray) static IntArrayFS
createIntArrayFS
(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 IntegerList
createIntegerList
(JCas aJCas, int... aValues) static IntegerList
createIntegerList
(JCas aJCas, Collection<Integer> aCollection) static LongArray
createLongArray
(JCas aJCas, long... aArray) static LongArray
createLongArray
(JCas aJCas, Collection<Long> aCollection) static LongArrayFS
createLongArrayFS
(CAS aCas, long... aArray) static LongArrayFS
createLongArrayFS
(CAS aCas, Collection<Long> aCollection) static ShortArray
createShortArray
(JCas aJCas, short... aArray) static ShortArray
createShortArray
(JCas aJCas, Collection<Short> aCollection) static ShortArrayFS
createShortArrayFS
(CAS aCas, short... aArray) static ShortArrayFS
createShortArrayFS
(CAS aCas, Collection<Short> aCollection) static StringArray
createStringArray
(JCas aJCas, String... aArray) static StringArray
createStringArray
(JCas aJCas, Collection<String> aCollection) static StringArrayFS
createStringArrayFS
(CAS aCas, String... aArray) static StringArrayFS
createStringArrayFS
(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 StringList
createStringList
(JCas aJCas, String... aValues) static StringList
createStringList
(JCas aJCas, Collection<String> aCollection) static BooleanArray
fillArray
(BooleanArray aArray, boolean... aValues) static BooleanArray
fillArray
(BooleanArray aArray, Iterable<Boolean> aValues) static ByteArray
static ByteArray
static DoubleArray
fillArray
(DoubleArray aArray, double... aValues) static DoubleArray
fillArray
(DoubleArray aArray, Iterable<Double> aValues) static FloatArray
fillArray
(FloatArray aArray, float... aValues) static FloatArray
fillArray
(FloatArray aArray, Iterable<Float> aValues) static <T extends FeatureStructure>
FSArray<T> static <T extends FeatureStructure>
FSArray<T> fillArray
(FSArray<T> aArray, FeatureStructure... aValues) static IntegerArray
fillArray
(IntegerArray aArray, int... aValues) static IntegerArray
fillArray
(IntegerArray aArray, Iterable<Integer> aValues) static LongArray
static LongArray
static ShortArray
fillArray
(ShortArray aArray, short... aValues) static ShortArray
fillArray
(ShortArray aArray, Iterable<Short> aValues) static StringArray
fillArray
(StringArray aArray, Iterable<String> aValues) static StringArray
fillArray
(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 BooleanArrayFS
fillArrayFS
(BooleanArrayFS aArrayFs, boolean... aValues) static BooleanArrayFS
fillArrayFS
(BooleanArrayFS aArrayFs, Iterable<Boolean> aValues) static ByteArrayFS
fillArrayFS
(ByteArrayFS aArrayFs, byte... aValues) static ByteArrayFS
fillArrayFS
(ByteArrayFS aArrayFs, Iterable<Byte> aValues) static DoubleArrayFS
fillArrayFS
(DoubleArrayFS aArrayFs, double... aValues) static DoubleArrayFS
fillArrayFS
(DoubleArrayFS aArrayFs, Iterable<Double> aValues) static FloatArrayFS
fillArrayFS
(FloatArrayFS aArrayFs, float... aValues) static FloatArrayFS
fillArrayFS
(FloatArrayFS aArrayFs, Iterable<Float> aValues) static IntArrayFS
fillArrayFS
(IntArrayFS aArrayFs, int... aValues) static IntArrayFS
fillArrayFS
(IntArrayFS aArrayFs, Iterable<Integer> aValues) static LongArrayFS
fillArrayFS
(LongArrayFS aArrayFs, long... aValues) static LongArrayFS
fillArrayFS
(LongArrayFS aArrayFs, Iterable<Long> aValues) static ShortArrayFS
fillArrayFS
(ShortArrayFS aArrayFs, short... aValues) static ShortArrayFS
fillArrayFS
(ShortArrayFS aArrayFs, Iterable<Short> aValues) static StringArrayFS
fillArrayFS
(StringArrayFS aArrayFs, Iterable<String> aValues) static StringArrayFS
fillArrayFS
(StringArrayFS aArrayFs, String... aValues)
-
Method Details
-
create
Deprecated.Usecas.select(type).asList()
Create aCollection
of 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
Collection
of the given type of feature structures backed live by the CAS. - See Also:
-
create
Convert anFSIterator
to 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 anAnnotationIndex
to aCollection
.- Type Parameters:
T
- the feature structure type- Parameters:
aIndex
- the index to convert.- Returns:
- the wrapped index.
- See Also:
-
create
Convert anArrayFS
to 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()