Package org.apache.uima.cas.impl
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 Summary
FieldsModifier and TypeFieldDescriptionprivate int
the index of the current iteratorprivate static final AtomicInteger
Fields inherited from class org.apache.uima.cas.impl.FsIterator_multiple_indexes
allIterators, comparatorMaybeNoTypeWithoutId, main_idx, nonEmptyIterators
Fields inherited from interface org.apache.uima.cas.impl.LowLevelIterator
FS_ITERATOR_LOW_LEVEL_EMPTY, IS_ORDERED
-
Constructor Summary
ConstructorsConstructorDescriptioncopy constructorFsIterator_aggregation_common
(LowLevelIterator<T>[] iterators, FSIndex<T> index, Comparator<TOP> comparatorMaybeNoTypeWithoutId) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copy this iterator.getNvc()
Get the structure the iterator is pointing at.boolean
boolean
isValid()
Check if this iterator is valid.int
int
void
moves to the first non-empty iterator at its start positionvoid
Internal use same as moveToLast, but won't reset to use current contents of index if index has changedvoid
version of moveToNext which bypasses the isValid check - call only if you've just done this check yourselfvoid
MoveTo for this kind of iterator Happens for set or sorted indexes being operated without rattling, or for other kinds of aggregation.void
version of moveToPrevious which bypasses the isValid check - call only if you've just done this check yourselftoString()
Methods inherited from class org.apache.uima.cas.impl.FsIterator_multiple_indexes
isIndexesHaveBeenUpdated, ll_getIndex, maybeReinitIterator, separate_into_empty_indexes_and_non_empty_iterators, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.uima.cas.FSIterator
add, get, getType, hasNext, hasPrevious, moveToNext, moveToPrevious, 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, ll_get, ll_remove, moveTo, moveTo, moveToFirst, moveToLast
-
Field Details
-
moveTo_error_msg_count
-
current_it_idx
private int current_it_idxthe index of the current iterator
-
-
Constructor Details
-
FsIterator_aggregation_common
FsIterator_aggregation_common(LowLevelIterator<T>[] iterators, FSIndex<T> index, Comparator<TOP> comparatorMaybeNoTypeWithoutId) -
FsIterator_aggregation_common
FsIterator_aggregation_common(FsIterator_aggregation_common<T> v) copy constructor
-
-
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
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
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 interfaceLowLevelIterator<T extends FeatureStructure>
- Overrides:
ll_indexSizeMaybeNotCurrent
in classFsIterator_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 interfaceLowLevelIterator<T extends FeatureStructure>
- Overrides:
ll_maxAnnotSpan
in classFsIterator_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
-
getComparator
- Returns:
- the comparator used by this iterator. It is always a withoutID style, and may be either a withType or NoType style.
-