Adam Lally wrote:
FYI, a while back I posted some code we could consider adding for JCAS
that allow you to get iterators parameterized by specific JCAS types:
http://www.mail-archive.com/[email protected]/msg04657.html

It might be interesting to consider adding something like that
directly on the JCAS interface.

 -Adam
I changed my mind a little about adding this specific method
to the JCas class, because the same issue is true for the normal
CAS where people might want to use for each to iterate
over our built in types.

I think we should add something like that to the FSIndexRepository.

For the methods which return an FSIndex that would work quite well,
but not for getAllIndexedFS, because it returns an FSItertor which
cannot be used together with the for each statement.

One way to solve it would be to let the new getAllIndexedFS method return
a Collection or let FSIterator extend Iterable. Though I am not sure what
are the consequences to have an Iterator extending Iterable.

Jörn

Reply via email to