uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Lally" <ala...@alum.rpi.edu>
Subject Re: [jira] Commented: (UIMA-25) Implement better support for arrays of Feature Structures
Date Thu, 07 Dec 2006 15:16:38 GMT
On 12/7/06, Thilo Goetz <twgoetz@gmx.de> wrote:
><snip/>
>
> I appreciate your comments about the Java collection framework.  We've
> talked about this on and off, but it never really went anywhere.  Is
> this something we might want to support in JCas?  That would seem like a
> good place for it.
>
> Opinions?
>

I think it is reasonable for FSArray to provide an iterator() method
for both JCAS and CAS.  The only reason I could think of for not
wanting to do it in CAS is to keep the CAS APIs as similar as possible
to the C++ CAS APIs.  But I think we may want some flexibility there
to do some simple things that make Java programmers' lives easier.

A stickier question is whether FSArray should implement Collection.
It could only be an unmodifiable Collection since arrays are fixed
sized.  An advantage of implementing Collection is that users on Java
5 could use the new for(element : collection) construction, but we
still remain 1.4-compatible.

FSList could definitely implement Collection since add() and remove()
can be implemented.  (This would be in JCAS, since I don't believe we
have a special Java class for FSList in CAS - it's just treated as an
ordinary FeatureStructure.)

-Adam

Mime
View raw message