I got a user request for an unambiguous, filtered iterator that
filters first, then applies the unambiguousness constraint.  (An
unambiguous iterator is one where the next annotation returned is
guaranteed not to overlap with the previous annotation returned.)

It seems easy to do this: all we need to do is create a new instance
of the Subiterator class using new Subiterator(filteredIter), where
filteredIter is the filtered iterator.  Users can't call this directly
since Subiterator is package-private.

What would be a good public API for this?  Two ideas are:

static CAS.createUnambiguousIterator(Iterator iter)
static AnnotationIndex.createUnambiguousIterator(Iterator iter)


These are analogous to CAS.createFilteredIterator(Iterator iter).
However for unambiguous iterators, the Iterator must be an iterator
over the Annotation index, not some user-defined index..  So perhaps
making this a static method of AnnotationIndex is more clear.

Thoughts?

-Adam

Reply via email to