Class FsIterator_multiple_indexes<T extends FeatureStructure>

  • Type Parameters:
    T - the highest type returned by these iterators
    All Implemented Interfaces:
    java.util.Iterator<T>, java.util.ListIterator<T>, FSIterator<T>, LowLevelIterator<T>
    Direct Known Subclasses:
    FsIterator_aggregation_common, FsIterator_subtypes_ordered

    public abstract class FsIterator_multiple_indexes<T extends FeatureStructure>
    extends java.lang.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
    • Constructor Detail

      • FsIterator_multiple_indexes

        public FsIterator_multiple_indexes​(LowLevelIndex<T> main_idx,
                                           LowLevelIterator<T>[] iterators,
                                           java.util.Comparator<TOP> comparatorMaybeNoTypeWithoutId)
      • FsIterator_multiple_indexes

        public FsIterator_multiple_indexes​(FsIterator_multiple_indexes<T> v)
        /** copy constructor
        Parameters:
        v - the original to copy
    • Method Detail

      • 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()
      • 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.
      • empty_became_nonEmpty

        private boolean empty_became_nonEmpty()
      • 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.