Class FSList<T extends TOP>

Type Parameters:
T - the type of the elements in the list
All Implemented Interfaces:
Cloneable, Iterable<T>, FeatureStructure, FeatureStructureImpl, CommonList
Direct Known Subclasses:
EmptyFSList, NonEmptyFSList

public abstract class FSList<T extends TOP> extends TOP implements CommonList, Iterable<T>
T extends TOP, v2 already mandated TOP for set/get
  • Constructor Details

    • FSList

      protected FSList()
    • FSList

      public FSList(JCas jcas)
    • FSList

      public FSList(TypeImpl t, CASImpl c)
      used by generator Make a new AnnotationBase
      Parameters:
      c - -
      t - -
  • Method Details

    • getNthElement

      public T getNthElement(int i)
    • createNonEmptyNode

      public NonEmptyFSList<T> createNonEmptyNode()
      Description copied from interface: CommonList
      Creates a non empty node
      Specified by:
      createNonEmptyNode in interface CommonList
      Returns:
      a new non empty node
    • pushNode

      public NonEmptyFSList<T> pushNode()
      Description copied from interface: CommonList
      Creates a new node and pushes it onto the front of the existing node
      Specified by:
      pushNode in interface CommonList
      Returns:
      the new node
    • select

      public <U extends T> SelectFSs<U> select()
      Treat an FSArray as a source for SelectFSs.
      Type Parameters:
      U - generic type being selected
      Returns:
      a new instance of SelectFSs
    • select

      public <U extends T> SelectFSs<U> select(Type filterByType)
      Treat an FSArray as a source for SelectFSs.
      Type Parameters:
      U - generic type being selected
      Parameters:
      filterByType - only includes elements of this type
      Returns:
      a new instance of SelectFSs
      Throws:
      IllegalArgumentException - if no type is specified.
    • select

      public <U extends T> SelectFSs<U> select(Class<U> filterByType)
      Treat an FSArray as a source for SelectFSs.
      Type Parameters:
      U - generic type being selected
      Parameters:
      filterByType - only includes elements of this JCas class
      Returns:
      a new instance of SelectFSs
      Throws:
      IllegalArgumentException - if no type is specified.
    • select

      public <U extends T> SelectFSs<U> select(int filterByType)
      Treat an FSArray as a source for SelectFSs.
      Type Parameters:
      U - generic type being selected
      Parameters:
      filterByType - only includes elements of this JCas class's type
      Returns:
      a new instance of SelectFSs
    • select

      public <U extends T> SelectFSs<U> select(String filterByType)
      Treat an FSArray as a source for SelectFSs.
      Type Parameters:
      U - generic type being selected
      Parameters:
      filterByType - only includes elements of this type (fully qualified type name)
      Returns:
      a new instance of SelectFSs
      Throws:
      IllegalArgumentException - if no type is specified.
    • create

      public static <U extends TOP, E extends FeatureStructure> FSList<U> create(JCas jcas, E[] a)
      Create an FSList from an existing array of Feature Structures
      Type Parameters:
      U - the type of FeatureStructures being stored in the FSList being created
      E - the type of the array argument
      Parameters:
      jcas - the JCas to use
      a - the array of Feature Structures to populate the list with
      Returns:
      an FSList, with the elements from the array
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends TOP>
    • push

      public NonEmptyFSList<T> push(T item)
      pushes item onto front of this list
      Parameters:
      item - the item to push onto the list
      Returns:
      the new list, with this item as the head value of the first element
    • stream

      public Stream<T> stream()
      Returns:
      a stream over this FSList
    • emptyList

      public EmptyFSList emptyList()
      Specified by:
      emptyList in interface CommonList
      Returns:
      a shared instance of the empty node.
    • contains

      public boolean contains(T v)