public interface ArrayFS<E extends FeatureStructure> extends CommonArrayFS<E>
CAS.createArrayFS(int length)
or
new FSArray(aJCas, length)Modifier and Type | Method and Description |
---|---|
<T extends FeatureStructure> |
copyFromArray(T[] src,
int srcOffset,
int destOffset,
int length)
Copy the contents of an external array into this array.
|
<U extends FeatureStructure> |
copyToArray(int srcOffset,
U[] dest,
int destOffset,
int length)
Copy the contents of the array from
start to end to the
destination destArray with destination offset destOffset . |
<U extends FeatureStructure> |
get(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> |
toArray(T[] a)
Populates an existing array from this FS Array.
|
copyFromArray, copyToArray, copyValuesFrom, getValuesAsCommaSeparatedString, isEmpty, size, toStringArray
_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
<U extends FeatureStructure> U get(int i) throws ArrayIndexOutOfBoundsException
U
- The class of the item being obtained by the geti
- indexArrayIndexOutOfBoundsException
- If the index is out of bounds.void set(int i, E fs) throws ArrayIndexOutOfBoundsException
i
- The index.fs
- The value.ArrayIndexOutOfBoundsException
- If i
is out of bounds.<U extends FeatureStructure> void copyToArray(int srcOffset, U[] dest, int destOffset, int length) throws ArrayIndexOutOfBoundsException
start
to end
to the
destination destArray
with destination offset destOffset
.U
- the type of the array elementsrcOffset
- The index of the first element to copy.dest
- The array to copy to.destOffset
- Where to start copying into dest
.length
- The number of elements to copy.ArrayIndexOutOfBoundsException
- If srcOffset < 0
or length > size()
or
destOffset + length > destArray.length
.<T extends FeatureStructure> void copyFromArray(T[] src, int srcOffset, int destOffset, int length) throws ArrayIndexOutOfBoundsException
T
- the class of the array being copied intosrc
- 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.ArrayIndexOutOfBoundsException
- If srcOffset < 0
or length > size()
or
destOffset + length > destArray.length
.FeatureStructure[] toArray()
<T extends TOP> T[] toArray(T[] a)
T
- the type of the elementa
- the existing arrayCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.