Package org.apache.uima.cas.impl
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 Summary
Modifier and TypeFieldDescriptionprotected final LowLevelIterator<T>[]
protected final Comparator<TOP>
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.protected final LowLevelIndex<T>
protected LowLevelIterator<T>[]
Fields inherited from interface org.apache.uima.cas.impl.LowLevelIterator
FS_ITERATOR_LOW_LEVEL_EMPTY, IS_ORDERED
-
Constructor Summary
ConstructorDescription/** copy constructorFsIterator_multiple_indexes
(LowLevelIndex<T> main_idx, LowLevelIterator<T>[] iterators, Comparator<TOP> comparatorMaybeNoTypeWithoutId) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the index for just the top most type of this iterator (excludes subtypes).int
int
boolean
Internal useprotected void
Also resets all non-empty iterators to current valuesint
size()
return the size of the collection being iterated over, if available.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.uima.cas.FSIterator
add, copy, get, getNvc, getType, hasNext, hasPrevious, isValid, moveToNext, moveToNextNvc, moveToPrevious, moveToPreviousNvc, next, nextIndex, nextNvc, previous, previousIndex, previousNvc, remove, set, spliterator, stream
Methods inherited from interface java.util.Iterator
forEachRemaining
Methods inherited from interface org.apache.uima.cas.impl.LowLevelIterator
getArrayList, getComparator, isMoveToSupported, ll_get, ll_remove, moveTo, moveTo, moveToFirst, moveToFirstNoReinit, moveToLast, moveToLastNoReinit, moveToNoReinit
-
Field Details
-
allIterators
-
nonEmptyIterators
-
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
-
-
Constructor Details
-
FsIterator_multiple_indexes
public FsIterator_multiple_indexes(LowLevelIndex<T> main_idx, LowLevelIterator<T>[] iterators, Comparator<TOP> comparatorMaybeNoTypeWithoutId) -
FsIterator_multiple_indexes
/** copy constructor- Parameters:
v
- the original to copy
-
-
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 interfaceLowLevelIterator<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 interfaceLowLevelIterator<T extends FeatureStructure>
- Returns:
- an estimate of the maximum span over all annotations (end - begin)
-
isIndexesHaveBeenUpdated
public boolean isIndexesHaveBeenUpdated()- Specified by:
isIndexesHaveBeenUpdated
in interfaceLowLevelIterator<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 interfaceLowLevelIterator<T extends FeatureStructure>
- Returns:
- true if the iterator was refreshed to match the current index
-
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 interfaceLowLevelIterator<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 interfaceFSIterator<T extends FeatureStructure>
- Returns:
- the size of the collection being iterated over.
-