Interface ArrayFS<E extends FeatureStructure>

All Superinterfaces:
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, use CAS.createArrayFS(int length) or new FSArray(aJCas, length)
  • Method Details

    • get

      <U extends FeatureStructure> U get(int i) throws 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:
      ArrayIndexOutOfBoundsException - If the index is out of bounds.
    • set

      void set(int i, E fs) throws ArrayIndexOutOfBoundsException
      Set the i-th value.
      Parameters:
      i - The index.
      fs - The value.
      Throws:
      ArrayIndexOutOfBoundsException - If i is out of bounds.
    • copyToArray

      <U extends FeatureStructure> void copyToArray(int srcOffset, U[] dest, int destOffset, int length) throws ArrayIndexOutOfBoundsException
      Copy the contents of the array from start to end to the destination destArray with destination offset destOffset.
      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 into dest.
      length - The number of elements to copy.
      Throws:
      ArrayIndexOutOfBoundsException - If srcOffset < 0 or length > size() or destOffset + length > destArray.length.
    • copyFromArray

      <T extends FeatureStructure> void copyFromArray(T[] src, int srcOffset, int destOffset, int length) throws 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:
      ArrayIndexOutOfBoundsException - If srcOffset < 0 or length > size() or destOffset + 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