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:
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 Summary
Fields Modifier and Type Field Description private int
current_it_idx
the index of the current iteratorprivate static java.util.concurrent.atomic.AtomicInteger
moveTo_error_msg_count
-
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
Constructors Constructor Description FsIterator_aggregation_common(FsIterator_aggregation_common<T> v)
copy constructorFsIterator_aggregation_common(LowLevelIterator<T>[] iterators, FSIndex<T> index, java.util.Comparator<TOP> comparatorMaybeNoTypeWithoutId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FsIterator_aggregation_common<T>
copy()
Copy this iterator.java.util.Comparator<TOP>
getComparator()
T
getNvc()
Get the structure the iterator is pointing at.boolean
isMoveToSupported()
boolean
isValid()
Check if this iterator is valid.int
ll_indexSizeMaybeNotCurrent()
int
ll_maxAnnotSpan()
void
moveToFirstNoReinit()
moves to the first non-empty iterator at its start positionvoid
moveToLastNoReinit()
Internal use same as moveToLast, but won't reset to use current contents of index if index has changedvoid
moveToNextNvc()
version of moveToNext which bypasses the isValid check - call only if you've just done this check yourselfvoid
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.void
moveToPreviousNvc()
version of moveToPrevious which bypasses the isValid check - call only if you've just done this check yourselfjava.lang.String
toString()
-
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 org.apache.uima.cas.impl.LowLevelIterator
getArrayList, ll_get, ll_remove, moveTo, moveTo, moveToFirst, moveToLast
-
-
-
-
Constructor Detail
-
FsIterator_aggregation_common
FsIterator_aggregation_common(LowLevelIterator<T>[] iterators, FSIndex<T> index, java.util.Comparator<TOP> comparatorMaybeNoTypeWithoutId)
-
FsIterator_aggregation_common
FsIterator_aggregation_common(FsIterator_aggregation_common<T> v)
copy constructor
-
-
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
-
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
public FsIterator_aggregation_common<T> copy()
Description copied from interface:FSIterator
Copy this iterator.- Returns:
- A copy of this iterator, pointing at the same element.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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.
-
-