Class FsIterator_aggregation_common<T extends FeatureStructure>

  • All Implemented Interfaces:
    java.util.Iterator<T>, java.util.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 Detail

      • moveTo_error_msg_count

        private static final java.util.concurrent.atomic.AtomicInteger moveTo_error_msg_count
      • current_it_idx

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

      • FsIterator_aggregation_common

        FsIterator_aggregation_common​(LowLevelIterator<T>[] iterators,
                                      FSIndex<T> index,
                                      java.util.Comparator<TOP> comparatorMaybeNoTypeWithoutId)
    • Method Detail

      • 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 java.util.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:
        java.util.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
      • toString

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

        public java.util.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.