Package org.apache.uima.cas.impl
Class FilteredIterator<T extends FeatureStructure>
- java.lang.Object
-
- org.apache.uima.cas.impl.FilteredIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>,java.util.ListIterator<T>,FSIterator<T>,LowLevelIterator<T>
class FilteredIterator<T extends FeatureStructure> extends java.lang.Object implements LowLevelIterator<T>
Implements a filtered iterator.
-
-
Field Summary
Fields Modifier and Type Field Description private FSMatchConstraintconsprivate LowLevelIterator<T>it-
Fields inherited from interface org.apache.uima.cas.impl.LowLevelIterator
FS_ITERATOR_LOW_LEVEL_EMPTY, IS_ORDERED
-
-
Constructor Summary
Constructors Modifier Constructor Description privateFilteredIterator()(package private)FilteredIterator(FSIterator<T> it, FSMatchConstraint cons)Create a filtered iterator from a base iterator and a constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidadjustForConstraintBackward()private voidadjustForConstraintForward()FilteredIterator<T>copy()Copy this iterator.java.util.Comparator<TOP>getComparator()TgetNvc()Get the structure the iterator is pointing at.booleanisIndexesHaveBeenUpdated()booleanisValid()Check if this iterator is valid.LowLevelIndex<T>ll_getIndex()Get the index for just the top most type of this iterator (excludes subtypes).intll_indexSizeMaybeNotCurrent()intll_maxAnnotSpan()booleanmaybeReinitIterator()Internal usevoidmoveToFirstNoReinit()Internal use same as moveToFirst, but won't reset to use current contents of index if index has changedvoidmoveToLastNoReinit()Internal use same as moveToLast, but won't reset to use current contents of index if index has changedvoidmoveToNextNvc()version of moveToNext which bypasses the isValid check - call only if you've just done this check yourselfvoidmoveToNoReinit(FeatureStructure fs)Internal use same as moveTo(fs), but won't reset to use current contents of index if index has changedvoidmoveToPreviousNvc()version of moveToPrevious which bypasses the isValid check - call only if you've just done this check yourself-
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, get, getType, hasNext, hasPrevious, moveToNext, moveToPrevious, next, nextIndex, nextNvc, previous, previousIndex, previousNvc, remove, set, size, spliterator, stream
-
Methods inherited from interface org.apache.uima.cas.impl.LowLevelIterator
getArrayList, isMoveToSupported, ll_get, ll_remove, moveTo, moveTo, moveToFirst, moveToLast
-
-
-
-
Field Detail
-
it
private LowLevelIterator<T extends FeatureStructure> it
-
cons
private FSMatchConstraint cons
-
-
Constructor Detail
-
FilteredIterator
private FilteredIterator()
-
FilteredIterator
FilteredIterator(FSIterator<T> it, FSMatchConstraint cons)
Create a filtered iterator from a base iterator and a constraint.
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from interface:FSIteratorCheck if this iterator is valid.- Specified by:
isValidin interfaceFSIterator<T extends FeatureStructure>- Returns:
trueif the iterator is valid.
-
adjustForConstraintForward
private void adjustForConstraintForward()
-
adjustForConstraintBackward
private void adjustForConstraintBackward()
-
moveToFirstNoReinit
public void moveToFirstNoReinit()
Description copied from interface:LowLevelIteratorInternal use same as moveToFirst, but won't reset to use current contents of index if index has changed- Specified by:
moveToFirstNoReinitin interfaceLowLevelIterator<T extends FeatureStructure>
-
moveToLastNoReinit
public void moveToLastNoReinit()
Description copied from interface:LowLevelIteratorInternal use same as moveToLast, but won't reset to use current contents of index if index has changed- Specified by:
moveToLastNoReinitin interfaceLowLevelIterator<T extends FeatureStructure>
-
moveToNextNvc
public void moveToNextNvc()
Description copied from interface:FSIteratorversion of moveToNext which bypasses the isValid check - call only if you've just done this check yourself- Specified by:
moveToNextNvcin interfaceFSIterator<T extends FeatureStructure>
-
moveToPreviousNvc
public void moveToPreviousNvc()
Description copied from interface:FSIteratorversion of moveToPrevious which bypasses the isValid check - call only if you've just done this check yourself- Specified by:
moveToPreviousNvcin interfaceFSIterator<T extends FeatureStructure>
-
getNvc
public T getNvc()
Description copied from interface:FSIteratorGet the structure the iterator is pointing at. Throws various unchecked exceptions, if the iterator is not valid- Specified by:
getNvcin interfaceFSIterator<T extends FeatureStructure>- Returns:
- The structure the iterator is pointing at.
-
copy
public FilteredIterator<T> copy()
Description copied from interface:FSIteratorCopy this iterator.- Specified by:
copyin interfaceFSIterator<T extends FeatureStructure>- Returns:
- A copy of this iterator, pointing at the same element.
- See Also:
FSIterator.copy()
-
moveToNoReinit
public void moveToNoReinit(FeatureStructure fs)
Description copied from interface:LowLevelIteratorInternal use same as moveTo(fs), but won't reset to use current contents of index if index has changed- Specified by:
moveToNoReinitin interfaceLowLevelIterator<T extends FeatureStructure>- Parameters:
fs- the fs to use as the template identifying the place to move to- See Also:
FSIterator.moveTo(FeatureStructure)
-
ll_indexSizeMaybeNotCurrent
public int ll_indexSizeMaybeNotCurrent()
- Specified by:
ll_indexSizeMaybeNotCurrentin 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_getIndex
public LowLevelIndex<T> ll_getIndex()
Description copied from interface:LowLevelIteratorGet the index for just the top most type of this iterator (excludes subtypes).- Specified by:
ll_getIndexin interfaceLowLevelIterator<T extends FeatureStructure>- Returns:
- The index.
-
ll_maxAnnotSpan
public int ll_maxAnnotSpan()
- Specified by:
ll_maxAnnotSpanin interfaceLowLevelIterator<T extends FeatureStructure>- Returns:
- an estimate of the maximum span over all annotations (end - begin)
-
isIndexesHaveBeenUpdated
public boolean isIndexesHaveBeenUpdated()
- Specified by:
isIndexesHaveBeenUpdatedin 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:LowLevelIteratorInternal use- Specified by:
maybeReinitIteratorin interfaceLowLevelIterator<T extends FeatureStructure>- Returns:
- true if the iterator was refreshed to match the current index
-
getComparator
public java.util.Comparator<TOP> getComparator()
- Specified by:
getComparatorin interfaceLowLevelIterator<T extends FeatureStructure>- Returns:
- the comparator used by this iterator. It is always a withoutID style, and may be either a withType or NoType style.
-
-