Class FSArrayList<T extends TOP>

Type Parameters:
T - the generic type
All Implemented Interfaces:
Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, CommonArrayFS<T>, FeatureStructure, FeatureStructureImpl, SelectViaCopyToArray<T>, UimaSerializable, UimaSerializableFSs

public class FSArrayList<T extends TOP> extends TOP implements UimaSerializableFSs, CommonArrayFS<T>, SelectViaCopyToArray<T>, List<T>, RandomAccess, Cloneable

An ArrayList type containing Feature Structures, for UIMA

  • Has all the methods of List
  • Implements the select(...) APIs

Implementation notes:

  • Uses UimaSerializable APIs
  • two implementations of the array list:
    • one uses the original FSArray, via an asList wrapper
    • This is used until an add or remove operation;
    • switches to ArrayList, resetting the original FSArray to null
  • This enables operation without creating the Java Object in use cases of deserializing and referencing when updating is not being used.
  • The values stored internally are non-PEAR ones.
  • The get/set/add operations convert to/from PEAR ones as needed
  • Field Details

    • EMPTY_LIST

      private static final List<? extends TOP> EMPTY_LIST
      The Constant EMPTY_LIST.
    • _TypeName

      public static final String _TypeName
      See Also:
    • typeIndexID

      public static final int typeIndexID
    • type

      public static final int type
    • fsArrayList

      private final ArrayList<T extends TOP> fsArrayList
      lifecycle - starts as empty array list - becomes non-empty when updated (add) -- used from that point on.
    • fsArray_asList

      private List<T extends TOP> fsArray_asList
      lifecycle - starts as the empty list - set when _init_from_cas_data() - set to null when update (add/remove) happens.
    • _FeatName_fsArray

      public static final String _FeatName_fsArray
      See Also:
    • _FC_fsArray

      private static final CallSite _FC_fsArray
    • _FH_fsArray

      private static final MethodHandle _FH_fsArray
  • Constructor Details

    • FSArrayList

      protected FSArrayList()
      Never called. Disable default constructor
    • FSArrayList

      public FSArrayList(TypeImpl type, CASImpl casImpl)
      Internal - constructor used by generator
      Parameters:
      type - the type of this Feature Structure
      casImpl - the CAS this Feature Structure belongs to
    • FSArrayList

      public FSArrayList(JCas jcas)
      Parameters:
      jcas - JCas to which this Feature Structure belongs
    • FSArrayList

      public FSArrayList(JCas jcas, int length)
      Make a new ArrayList with an initial size .
      Parameters:
      jcas - The JCas
      length - initial size
  • Method Details