Hi,
I observed some strange behavior of the iterator of the annotation index.
The method FSIterator<AnnotationFS>
org.apache.uima.cas.FSIndex.iterator(FeatureStructure fs) says:
Return an iterator over the index. The position of the iterator will be
set such that the feature structure returned by a call to the iterator's
get() method is greater than or equal to fs, and any previous FS is less
than FS. If no such position exists, the iterator will be invalid.
I have some code like the following:
FSIterator<AnnotationFS> it =
cas.getAnnotationIndex(type).iterator(pointer);
where the type of the pointer annotation is not the type given for the
index. The pointer annotation is near the last annotation of the type.
When I do something like the following...
if(result.isValid()) {
AnnotationFS a = result.get();
}
then a is the first annotation of the type "type".
Is that normal behavior? I would have expected an invalid iterator...
Best,
Peter