Class FsIterator_aggregation_common<T extends FeatureStructure>

java.lang.Object
org.apache.uima.cas.impl.FsIterator_multiple_indexes<T>
org.apache.uima.cas.impl.FsIterator_aggregation_common<T>
All Implemented Interfaces:
Iterator<T>, ListIterator<T>, FSIterator<T>, LowLevelIterator<T>

class FsIterator_aggregation_common<T extends FeatureStructure> extends FsIterator_multiple_indexes<T>
Aggregate several FS iterators. Simply iterates over one after the other without any sorting or merging. Used by getAllIndexedFS and FsIterator_subtypes when unordered underlying iterators could be any (bag, set, or ordered) underlying iterators could be complex (unambiguous annotation, filtered,...) The iterators can be for single types or for types with subtypes. Exception: if the ll_index is accessed, it is presumed to be of type FsIndex_subtypes.
  • Field Details

    • moveTo_error_msg_count

      private static final AtomicInteger moveTo_error_msg_count
    • current_it_idx

      private int current_it_idx
      the index of the current iterator
  • Constructor Details

  • Method Details

    • isMoveToSupported

      public boolean isMoveToSupported()
      Returns:
      false if this iterator is over an unordered collection or set or bag
    • isValid

      public boolean isValid()
      Description copied from interface: FSIterator
      Check if this iterator is valid.
      Returns:
      true if the iterator is valid.
    • getNvc

      public T getNvc() throws NoSuchElementException
      Description copied from interface: FSIterator
      Get the structure the iterator is pointing at. Throws various unchecked exceptions, if the iterator is not valid
      Returns:
      The structure the iterator is pointing at.
      Throws:
      NoSuchElementException
    • moveToNoReinit

      public void moveToNoReinit(FeatureStructure fs)
      MoveTo for this kind of iterator Happens for set or sorted indexes being operated without rattling, or for other kinds of aggregation. The meaning for set is to go to the position if it exists of the 1 element equal (using the index's comparator) the arg. But since the set is unordered, there's no point in doing this. The meaning for unordered other kinds: They're not really unordered, just the aggregate is unordered. A use would be to partially restart iteration from some point. But since this is unordered, there's not much point in doing this
      Parameters:
      fs - the fs to use as the template identifying the place to move to
    • moveToFirstNoReinit

      public void moveToFirstNoReinit()
      moves to the first non-empty iterator at its start position
    • moveToLastNoReinit

      public void moveToLastNoReinit()
      Description copied from interface: LowLevelIterator
      Internal use same as moveToLast, but won't reset to use current contents of index if index has changed
    • moveToNextNvc

      public void moveToNextNvc()
      Description copied from interface: FSIterator
      version of moveToNext which bypasses the isValid check - call only if you've just done this check yourself
    • moveToPreviousNvc

      public void moveToPreviousNvc()
      Description copied from interface: FSIterator
      version of moveToPrevious which bypasses the isValid check - call only if you've just done this check yourself
    • ll_indexSizeMaybeNotCurrent

      public int ll_indexSizeMaybeNotCurrent()
      Specified by:
      ll_indexSizeMaybeNotCurrent in interface LowLevelIterator<T extends FeatureStructure>
      Overrides:
      ll_indexSizeMaybeNotCurrent in class FsIterator_multiple_indexes<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>
      Overrides:
      ll_maxAnnotSpan in class FsIterator_multiple_indexes<T extends FeatureStructure>
      Returns:
      an estimate of the maximum span over all annotations (end - begin)
    • copy

      Description copied from interface: FSIterator
      Copy this iterator.
      Returns:
      A copy of this iterator, pointing at the same element.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getComparator

      public Comparator<TOP> getComparator()
      Returns:
      the comparator used by this iterator. It is always a withoutID style, and may be either a withType or NoType style.