Package org.apache.uima.cas
Interface ArrayFS<E extends FeatureStructure>
-
- All Superinterfaces:
java.lang.Cloneable
,CommonArrayFS<E>
,FeatureStructure
- All Known Subinterfaces:
ArrayFSImpl<E>
- All Known Implementing Classes:
FSArray
public interface ArrayFS<E extends FeatureStructure> extends CommonArrayFS<E>
Feature structure array interface. To create a FS array object, useCAS.createArrayFS(int length)
or new FSArray(aJCas, length)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends FeatureStructure>
voidcopyFromArray(T[] src, int srcOffset, int destOffset, int length)
Copy the contents of an external array into this array.<U extends FeatureStructure>
voidcopyToArray(int srcOffset, U[] dest, int destOffset, int length)
Copy the contents of the array fromstart
toend
to the destinationdestArray
with destination offsetdestOffset
.<U extends FeatureStructure>
Uget(int i)
Get the i-th feature structure from the array.void
set(int i, E fs)
Set the i-th value.FeatureStructure[]
toArray()
Creates a new array the this array is copied to.<T extends TOP>
T[]toArray(T[] a)
Populates an existing array from this FS Array.-
Methods inherited from interface org.apache.uima.cas.CommonArrayFS
copyFromArray, copyToArray, copyValuesFrom, getValuesAsCommaSeparatedString, isEmpty, size, toStringArray
-
Methods inherited from interface org.apache.uima.cas.FeatureStructure
_getTypeCode, _id, clone, equals, getAddress, getBooleanValue, getByteValue, getCAS, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getJCas, getLongValue, getShortValue, getStringValue, getType, hashCode, setBooleanValue, setByteValue, setDoubleValue, setFeatureValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue
-
-
-
-
Method Detail
-
get
<U extends FeatureStructure> U get(int i) throws java.lang.ArrayIndexOutOfBoundsException
Get the i-th feature structure from the array.- Type Parameters:
U
- The class of the item being obtained by the get- Parameters:
i
- index- Returns:
- The i-th feature structure.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- If the index is out of bounds.
-
set
void set(int i, E fs) throws java.lang.ArrayIndexOutOfBoundsException
Set the i-th value.- Parameters:
i
- The index.fs
- The value.- Throws:
java.lang.ArrayIndexOutOfBoundsException
- Ifi
is out of bounds.
-
copyToArray
<U extends FeatureStructure> void copyToArray(int srcOffset, U[] dest, int destOffset, int length) throws java.lang.ArrayIndexOutOfBoundsException
Copy the contents of the array fromstart
toend
to the destinationdestArray
with destination offsetdestOffset
.- Type Parameters:
U
- the type of the array element- Parameters:
srcOffset
- The index of the first element to copy.dest
- The array to copy to.destOffset
- Where to start copying intodest
.length
- The number of elements to copy.- Throws:
java.lang.ArrayIndexOutOfBoundsException
- IfsrcOffset < 0
orlength > size()
ordestOffset + length > destArray.length
.
-
copyFromArray
<T extends FeatureStructure> void copyFromArray(T[] src, int srcOffset, int destOffset, int length) throws java.lang.ArrayIndexOutOfBoundsException
Copy the contents of an external array into this array.- Type Parameters:
T
- the class of the array being copied into- Parameters:
src
- The source array.srcOffset
- Where to start copying in the source array.destOffset
- Where to start copying to in the destination array.length
- The number of elements to copy.- Throws:
java.lang.ArrayIndexOutOfBoundsException
- IfsrcOffset < 0
orlength > size()
ordestOffset + length > destArray.length
.
-
toArray
FeatureStructure[] toArray()
Creates a new array the this array is copied to. Return type is FeatureStructure to be backwards compatible with V2- Returns:
- A Java array copy of this FS array.
-
toArray
<T extends TOP> T[] toArray(T[] a)
Populates an existing array from this FS Array.- Type Parameters:
T
- the type of the element- Parameters:
a
- the existing array- Returns:
- the populated array
-
-