Package org.apache.uima.cas
Interface CommonArrayFS<E>
-
- All Superinterfaces:
java.lang.Cloneable,FeatureStructure
- All Known Subinterfaces:
ArrayFS<E>,ArrayFSImpl<E>,BooleanArrayFS,BooleanArrayFSImpl,ByteArrayFS,ByteArrayFSImpl,CommonArrayFSImpl,CommonPrimitiveArray<T>,DoubleArrayFS,DoubleArrayFSImpl,FloatArrayFS,FloatArrayFSImpl,IntArrayFS,IntArrayFSImpl,LongArrayFS,LongArrayFSImpl,ShortArrayFS,ShortArrayFSImpl,StringArrayFS,StringArrayFSImpl
- All Known Implementing Classes:
BooleanArray,ByteArray,DoubleArray,FloatArray,FSArray,FSArrayList,IntegerArray,IntegerArrayList,LongArray,ShortArray,StringArray
public interface CommonArrayFS<E> extends FeatureStructure
Common parts of the Array interfaces. Doesn't implement AbstactNonModifiableCollection because the specializations of things like toArray using primitives don't work
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcopyFromArray(java.lang.String[] src, int srcOffset, int destOffset, int length)Copy the contents of an external string array into this array.voidcopyToArray(int srcOffset, java.lang.String[] dest, int destOffset, int length)Copy the contents of the array to an external string array.voidcopyValuesFrom(CommonArrayFS<E> v)Copy values from another array of the same kinddefault java.lang.StringgetValuesAsCommaSeparatedString()default booleanisEmpty()intsize()Return the size of the array.default java.lang.String[]toStringArray()Creates a new string array and copies this array values into it.-
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
-
size
int size()
Return the size of the array.- Returns:
- The size of the array.
-
toStringArray
default java.lang.String[] toStringArray()
Creates a new string array and copies this array values into it.- Returns:
- A Java array copy of this array.
-
copyToArray
void copyToArray(int srcOffset, java.lang.String[] dest, int destOffset, int length) throws java.lang.ArrayIndexOutOfBoundsExceptionCopy the contents of the array to an external string array.- 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 < 0orlength > size()ordestOffset + length > destArray.length.
-
copyFromArray
void copyFromArray(java.lang.String[] src, int srcOffset, int destOffset, int length) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NumberFormatExceptionCopy the contents of an external string array into this array. The strings are parsed and converted to floats.- 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- When length conditions are not met.java.lang.NumberFormatException- When the input strings do not represent valid floats.java.lang.UnsupportedOperationException- When the array is an array of FSs.
-
getValuesAsCommaSeparatedString
default java.lang.String getValuesAsCommaSeparatedString()
- Returns:
- a comma-separated string of the string values of the elements of the array
-
copyValuesFrom
void copyValuesFrom(CommonArrayFS<E> v)
Copy values from another array of the same kind- Parameters:
v- the other array
-
isEmpty
default boolean isEmpty()
- Returns:
- true if the array is empty
-
-