Interface LowLevelIndex<T extends FeatureStructure>

    • Field Detail

      • FS_ID_COMPARATOR

        static final java.util.Comparator<TOP> FS_ID_COMPARATOR
    • 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

        java.util.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()
      • getSubIndex

        default <U extends TLowLevelIndex<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 TLowLevelIndex<U> getSubIndex​(java.lang.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 <N extends TSelectFSs<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 TSelectFSs<N> select​(java.lang.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 TSelectFSs<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 TSelectFSs<N> select​(java.lang.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 java.util.Collection<T extends FeatureStructure>
        Specified by:
        iterator in interface FSIndex<T extends FeatureStructure>
        Specified by:
        iterator in interface java.lang.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.