org.apache.uima.cas.impl

## Interface LowLevelIndex<T extends FeatureStructure>

- All Superinterfaces:
    Collection<T>, FSIndex<T>, Iterable<T>
  All Known Implementing Classes:
    FsIndex_annotation, FsIndex_bag, FsIndex_flat, FsIndex_set_sorted, FsIndex_singletype, FsIndex_snapshot

      public interface LowLevelIndex<T extends FeatureStructure>
      extends FSIndex<T>

  Low-level FS index object. Use to obtain low-level iterators.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Comparator<TOP>` | `FS_ID_COMPARATOR`
    `static boolean` | `IS_ORDERED` Internal use constants
    `static boolean` | `IS_TYPE_ORDER`

    - ### Fields inherited from interface org.apache.uima.cas.FSIndex

      `BAG_INDEX, DEFAULT_BAG_INDEX, SET_INDEX, SORTED_INDEX`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `flush()`
    `CASImpl` | `getCasImpl()`
    `Comparator<TOP>` | `getComparator()`
    `FSIndexComparator` | `getComparatorForIndexSpecs()` This is **NOT** a comparator for Feature Structures, but rather something that compares two comparator specifications
    `default org.apache.uima.internal.util.IntPointerIterator` | `getIntIterator()`
    `default <U extends T> LowLevelIndex<U>` | `getSubIndex(Class<? extends TOP> clazz)`
    `default <U extends T> LowLevelIndex<U>` | `getSubIndex(Type type)`
    `boolean` | `isSorted()`
    `default LowLevelIterator<T>` | `iterator()` Return an iterator over the index.
    `LowLevelIterator<T>` | `iterator(boolean orderNotNeeded, boolean ignoreType)` Internal use, used by select framework.
    `default int` | `ll_compare(int ref1, int ref2)` Compare two Feature structures, referred to by IDs
    `default LowLevelIterator<T>` | `ll_iterator()` Get a low-level FS iterator.
    `LowLevelIterator<T>` | `ll_iterator(boolean ambiguous)` Get a low-level, FS reference iterator.
    `int` | `ll_maxAnnotSpan()`
    `default SelectFSs<T>` | `select()`
    `default <N extends T> SelectFSs<N>` | `select(Class<N> clazz)`
    `default <N extends T> SelectFSs<N>` | `select(int jcasType)`
    `default <N extends T> SelectFSs<N>` | `select(String fullyQualifiedTypeName)`
    `default <N extends T> SelectFSs<N>` | `select(Type type)`

    - ### Methods inherited from interface org.apache.uima.cas.FSIndex

      `compare, contains, find, getIndexingStrategy, getType, iterator, size, stream, subType, subType, withSnapshotIterators`

    - ### Methods inherited from interface java.util.Collection

      `add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, toArray, toArray`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Field Detail

    - #### FS_ID_COMPARATOR

          static final Comparator<TOP> FS_ID_COMPARATOR

    - #### IS_ORDERED

          static final boolean IS_ORDERED

      Internal use constants
      See Also:
        Constant Field Values

    - #### IS_TYPE_ORDER

          static final boolean IS_TYPE_ORDER

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### ll_iterator

          default LowLevelIterator<T> ll_iterator()

      Get a low-level FS iterator.
      Returns:
        An iterator for this index.

    - #### ll_iterator

          LowLevelIterator<T> ll_iterator(boolean ambiguous)

      Get a low-level, FS reference iterator. This iterator can be disambiguated. This means that only non-overlapping annotations will be returned. Non-annotation FSs will be filtered in this mode.
      Parameters:
        `ambiguous` - When set to `false`, iterator will be disambiguated.
      Returns:
        An iterator for this index.

    - #### ll_compare

          default int ll_compare(int ref1,
                                 int ref2)

      Compare two Feature structures, referred to by IDs
      Parameters:
        `ref1` - -
        `ref2` - -
      Returns:
        -

    - #### getCasImpl

          CASImpl getCasImpl()

      Returns:
        a CAS View associated with this iterator

    - #### getComparatorForIndexSpecs

          FSIndexComparator getComparatorForIndexSpecs()

      This is **NOT** a comparator for Feature Structures, but rather something that compares two comparator specifications
      Returns:
        -

    - #### getComparator

          Comparator<TOP> getComparator()

      Returns:
        a comparator used by this index to compare Feature Structures For sets, the equal is used to determine set membership For sorted, the comparator is the sort order (this comparator is without the ID)

    - #### flush

          default void flush()

    - #### getIntIterator

          default org.apache.uima.internal.util.IntPointerIterator getIntIterator()

    - #### getSubIndex

          default <U extends T> LowLevelIndex<U> getSubIndex(Type type)

      Type Parameters:
        `U` - the type the subindex is over
      Parameters:
        `type` - which is a subtype of this index's type
      Returns:
        the index but just over this subtype

    - #### getSubIndex

          default <U extends T> LowLevelIndex<U> getSubIndex(Class<? extends TOP> clazz)

    - #### ll_maxAnnotSpan

          int ll_maxAnnotSpan()

      Returns:
        for annotation indexes, an conservative estimate the maximum span between begin and end The value may be larger than actual.

    - #### isSorted

          boolean isSorted()

      Returns:
        true if the index is sorted

    - #### select

          default SelectFSs<T> select()

      Specified by:
        `select` in interface `FSIndex<T extends FeatureStructure>`
      Returns:
        a newly created selection object for accessing feature structures

    - #### select

          default <N extends T> SelectFSs<N> select(Type type)

      Specified by:
        `select` in interface `FSIndex<T extends FeatureStructure>`
      Type Parameters:
        `N` - the Type of the elements being accessed
      Parameters:
        `type` - specifies the type (and subtypes of that type) to access
      Returns:
        a newly created selection object for accessing feature structures of that type and its subtypes

    - #### select

          default <N extends T> SelectFSs<N> select(Class<N> clazz)

      Specified by:
        `select` in interface `FSIndex<T extends FeatureStructure>`
      Type Parameters:
        `N` - the Type of the elements being accessed
      Parameters:
        `clazz` - a JCas class corresponding to the type (and subtypes of that type) to access
      Returns:
        a newly created selection object for accessing feature structures of that type and its subtypes

    - #### select

          default <N extends T> SelectFSs<N> select(int jcasType)

      Specified by:
        `select` in interface `FSIndex<T extends FeatureStructure>`
      Type Parameters:
        `N` - the Type of the elements being accessed
      Parameters:
        `jcasType` - the "type" field from the JCas class corresponding to the type (and subtypes of that type) to access
      Returns:
        a newly created selection object for accessing feature structures of that type and its subtypes

    - #### select

          default <N extends T> SelectFSs<N> select(String fullyQualifiedTypeName)

      Specified by:
        `select` in interface `FSIndex<T extends FeatureStructure>`
      Type Parameters:
        `N` - the Type of the elements being accessed
      Parameters:
        `fullyQualifiedTypeName` - the string name of the type to access
      Returns:
        a newly created selection object for accessing feature structures of that type and its subtypes

    - #### iterator

          default LowLevelIterator<T> iterator()

      Return an iterator over the index. The position of the iterator will be set to return the first item in the index. If the index is empty, the iterator position will be marked as invalid.
      Specified by:
        `iterator` in interface `Collection<T extends FeatureStructure>`
      Specified by:
        `iterator` in interface `FSIndex<T extends FeatureStructure>`
      Specified by:
        `iterator` in interface `Iterable<T extends FeatureStructure>`
      Returns:
        An FSIterator positioned at the beginning, or an invalid iterator.

    - #### iterator

          LowLevelIterator<T> iterator(boolean orderNotNeeded,
                                       boolean ignoreType)

      Internal use, used by select framework. Return an iterator over the index. The position of the iterator will be set to return the first item in the index. If the index is empty, the iterator position will be marked as invalid.
      Parameters:
        `orderNotNeeded` - if true, skips work while iterating to keep iterators over multiple types in sync.
        `ignoreType` - if true, the comparator used for moveTo leftmost operations will ignore typeOrder keys, if the index happens to define these
      Returns:
        An FSIterator positioned at the beginning, or an invalid iterator.

Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.