Package org.apache.uima.cas.impl
Class FSIndexFlat.FSIteratorFlat<TI extends FeatureStructure>
java.lang.Object
org.apache.uima.cas.impl.FSIteratorImplBase<TI>
org.apache.uima.cas.impl.FSIndexFlat.FSIteratorFlat<TI>
- All Implemented Interfaces:
Iterator<TI>
,FSIterator<TI>
,LowLevelIterator
- Enclosing class:
- FSIndexFlat<T extends FeatureStructure>
public static class FSIndexFlat.FSIteratorFlat<TI extends FeatureStructure>
extends FSIteratorImplBase<TI>
implements LowLevelIterator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FSIndexFlat<TI>
private final TI[]
iterator's Feature Structure array, points to the instance in existence when the iterator was created, from the FSIndexprivate final FSIndexRepositoryImpl.IndexIteratorCachePair<TI>
private final int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this iterator.get()
Get the structure the iterator is pointing at.(package private) int
getBegin()
(package private) int
getEnd()
(package private) String
idInfo()
boolean
boolean
isValid()
Check if the iterator is currently valid.int
ll_get()
Return the current FS reference.Get the index for just the top most type of this iterator (excludes subtypes).int
Return the size of the underlying index.void
moveTo
(int fsRef) Try to position the iterator so that the current element is greater than or equal tofsRef
, and previous elements are less thanfsRef
.(package private) void
moveTo
(int begin, int end) A special version of moveTo for subtypes of AnnotationFS, which moves to a particular begin/end (no type priority).void
Move the iterator to the first Feature Structure that is equal tofs
.private void
moveToCommon
(Comparator<TI> comparator, TI fs) void
Move iterator to first FS in index.void
Move iterator to last FS in index.void
Advance the iterator.void
Move the iterator back one position.next()
toString()
(package private) String
Methods inherited from class org.apache.uima.cas.impl.FSIteratorImplBase
hasNext, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
ifsa
iterator's Feature Structure array, points to the instance in existence when the iterator was created, from the FSIndex -
fsIndexFlat
-
iicp
-
pos
private int pos -
iteratorCasResets
private final int iteratorCasResets
-
-
Constructor Details
-
FSIteratorFlat
FSIteratorFlat(FSIndexFlat<TI> fsIndexFlat, TI[] fsa)
-
-
Method Details
-
toString
-
next
- Specified by:
next
in interfaceIterator<TI extends FeatureStructure>
- Overrides:
next
in classFSIteratorImplBase<TI extends FeatureStructure>
-
isValid
public boolean isValid()Description copied from interface:LowLevelIterator
Check if the iterator is currently valid.- Specified by:
isValid
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
isValid
in interfaceLowLevelIterator
- Returns:
true
iff the iterator is valid.
-
get
Description copied from interface:FSIterator
Get the structure the iterator is pointing at.- Specified by:
get
in interfaceFSIterator<TI extends FeatureStructure>
- Returns:
- The structure the iterator is pointing at.
- Throws:
NoSuchElementException
- If the iterator is not valid.
-
moveToNext
public void moveToNext()Description copied from interface:LowLevelIterator
Advance the iterator. This may invalidate the iterator.- Specified by:
moveToNext
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
moveToNext
in interfaceLowLevelIterator
-
moveToPrevious
public void moveToPrevious()Description copied from interface:LowLevelIterator
Move the iterator back one position. This may invalidate the iterator.- Specified by:
moveToPrevious
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
moveToPrevious
in interfaceLowLevelIterator
-
moveToFirst
public void moveToFirst()Description copied from interface:LowLevelIterator
Move iterator to first FS in index. A subsequent call toisValid()
will succeed iff the index is non-empty.- Specified by:
moveToFirst
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
moveToFirst
in interfaceLowLevelIterator
-
moveToLast
public void moveToLast()Description copied from interface:LowLevelIterator
Move iterator to last FS in index. A subsequent call toisValid()
will succeed iff the index is non-empty.- Specified by:
moveToLast
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
moveToLast
in interfaceLowLevelIterator
-
moveTo
Description copied from interface:FSIterator
Move the iterator to the first Feature Structure that is equal tofs
. First means the earliest one occurring in the index, in case multiple FSs that are "equal" to fs are in the index. If no such feature structure exists in the underlying collection, set the iterator to the "insertion point" forfs
, i.e., to a point where the current feature structure is greater thanfs
, and the previous one is less thanfs
.If the fs is greater than all of the entries in the index, the moveTo cannot set the iterator to an insertion point where the current feature structure is greater than fs, so it marks the iterator "invalid".
If the underlying index is a bag index, no ordering is present, and the moveTo operation moves to the fs which is the same identical fs as the key. If no such fs is in the index, the iterator is marked invalid.
- Specified by:
moveTo
in interfaceFSIterator<TI extends FeatureStructure>
- Parameters:
fs
- The feature structure the iterator that supplies the comparison information. It must be of type T or a subtype of T.
-
moveTo
void moveTo(int begin, int end) Description copied from class:FSIteratorImplBase
A special version of moveTo for subtypes of AnnotationFS, which moves to a particular begin/end (no type priority).- Overrides:
moveTo
in classFSIteratorImplBase<TI extends FeatureStructure>
- Parameters:
begin
- the starting point (inclusive)end
- the ending point (inclusive)
-
moveToCommon
-
copy
Description copied from interface:LowLevelIterator
Create a copy of this iterator. The copy will point at the same element that this iterator is currently pointing at.- Specified by:
copy
in interfaceFSIterator<TI extends FeatureStructure>
- Specified by:
copy
in interfaceLowLevelIterator
- Returns:
- A copy of this iterator.
-
isUpdateFreeSinceLastCounterReset
public boolean isUpdateFreeSinceLastCounterReset() -
verifyFsaSubsumes
String verifyFsaSubsumes() -
idInfo
String idInfo() -
ll_get
Description copied from interface:LowLevelIterator
Return the current FS reference.- Specified by:
ll_get
in interfaceLowLevelIterator
- Returns:
- The current FS reference.
- Throws:
NoSuchElementException
- Iff the iterator is not valid.
-
moveTo
public void moveTo(int fsRef) Description copied from interface:LowLevelIterator
Try to position the iterator so that the current element is greater than or equal tofsRef
, and previous elements are less thanfsRef
. This may invalidate the iterator. If fsRef can not be compared to FSs in the index, the results are undefined.- Specified by:
moveTo
in interfaceLowLevelIterator
- Parameters:
fsRef
- The FS reference the iterator should be set to.
-
ll_indexSize
public int ll_indexSize()Description copied from interface:LowLevelIterator
Return the size of the underlying index.- Specified by:
ll_indexSize
in interfaceLowLevelIterator
- Returns:
- The size of the 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
- Returns:
- The index.
-
getBegin
int getBegin()- Overrides:
getBegin
in classFSIteratorImplBase<TI extends FeatureStructure>
-
getEnd
int getEnd()- Overrides:
getEnd
in classFSIteratorImplBase<TI extends FeatureStructure>
-