Class FsIterator_multiple_indexes<T extends FeatureStructure>

java.lang.Object
org.apache.uima.cas.impl.FsIterator_multiple_indexes<T>
Type Parameters:
T - the highest type returned by these iterators
All Implemented Interfaces:
Iterator<T>, ListIterator<T>, FSIterator<T>, LowLevelIterator<T>
Direct Known Subclasses:
FsIterator_subtypes_ordered

public abstract class FsIterator_multiple_indexes<T extends FeatureStructure> extends Object implements LowLevelIterator<T>
Common code for both aggregation of indexes (e.g. select, iterating over multiple views) aggregation of indexes in type/subtype hierarchy Supports creating corresponding iterators just for the non-empty ones Supports reinit - evaluating when one or more formerly empty indexes is no longer empty, and recalculating the iterator set Supports move-to-leftmost when typeOrdering is to be ignored -- when no typeorder key -- when typeorder key, but select framework requests no typeordering for move to leftmost
  • Field Details

    • allIterators

      protected final LowLevelIterator<T extends FeatureStructure>[] allIterators
    • nonEmptyIterators

      protected LowLevelIterator<T extends FeatureStructure>[] nonEmptyIterators
    • comparatorMaybeNoTypeWithoutId

      protected final Comparator<TOP> comparatorMaybeNoTypeWithoutId
      for set and sorted, both ignore id because this comparator is not used for comparing within the index, only for compares between index items and outside args. if ignoring type, uses that style
    • main_idx

      protected final LowLevelIndex<T extends FeatureStructure> main_idx
  • Constructor Details

  • Method Details

    • separate_into_empty_indexes_and_non_empty_iterators

      protected void separate_into_empty_indexes_and_non_empty_iterators()
      Also resets all non-empty iterators to current values
    • ll_indexSizeMaybeNotCurrent

      public int ll_indexSizeMaybeNotCurrent()
      Specified by:
      ll_indexSizeMaybeNotCurrent in interface LowLevelIterator<T extends FeatureStructure>
      Returns:
      The size of the index. In case of copy-on-write, this returns the size of the index at the time the iterator was created, or at the last moveTo, moveToFirst, or moveToLast. To get the current index size, use ll_getIndex().getSize()
    • ll_maxAnnotSpan

      public int ll_maxAnnotSpan()
      Specified by:
      ll_maxAnnotSpan in interface LowLevelIterator<T extends FeatureStructure>
      Returns:
      an estimate of the maximum span over all annotations (end - begin)
    • isIndexesHaveBeenUpdated

      public boolean isIndexesHaveBeenUpdated()
      Specified by:
      isIndexesHaveBeenUpdated in interface LowLevelIterator<T extends FeatureStructure>
      Returns:
      true if one or more of the underlying indexes this iterator goes over, has been updated since initialization or resetting operation (moveToFirst/Last/feature_structure). This includes empty iterators becoming non-empty.
    • maybeReinitIterator

      public boolean maybeReinitIterator()
      Description copied from interface: LowLevelIterator
      Internal use
      Specified by:
      maybeReinitIterator in interface LowLevelIterator<T extends FeatureStructure>
      Returns:
      true if the iterator was refreshed to match the current index
    • ll_getIndex

      public LowLevelIndex<T> ll_getIndex()
      Description copied from interface: LowLevelIterator
      Get the index for just the top most type of this iterator (excludes subtypes).
      Specified by:
      ll_getIndex in interface LowLevelIterator<T extends FeatureStructure>
      Returns:
      The index.
    • size

      public int size()
      Description copied from interface: FSIterator
      return the size of the collection being iterated over, if available. Because the iterator can move forwards and backwards, the size is the total size that the iterator would iterate over, starting at the first element thru the last element. This may be inefficient to compute.
      Specified by:
      size in interface FSIterator<T extends FeatureStructure>
      Returns:
      the size of the collection being iterated over.