uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marshall Schor (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-4299) improve generics for UIMA indexes and iterators
Date Thu, 09 Apr 2015 20:16:17 GMT

    [ https://issues.apache.org/jira/browse/UIMA-4299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14488186#comment-14488186
] 

Marshall Schor commented on UIMA-4299:
--------------------------------------

Interesting...  What this does, I think, is allow the type inferencing system to pull the
surrounding context's type info into this.  So in the context:
{code}Iterator<FSIndex<FeatureStructure>> indexes = aSrcCasView.getIndexRepository().getIndexes();{code}
this pulls the info from the left-hand side of the assignment over into the right side, so
it now "matches".  Or something like that...   I confess to some lack of complete understanding
of the subtleties of generics...

So, I'm guessing if the left side said <FSIndex<Annotation>> that would also "work"
but it would of course be incorrect because the index Repository getIndexes() method really
is returning indexes that might be defined over all kinds of Types many of which might not
be Annotation. .  

I think the unknown-ness of this is better expressed by <? extends FeatureStructure>.
 But I do agree it could be a backwards compatibility issue.  

I guess I'm slightly in favor of keeping it as <? extends FeatureStructure> unless it
starts being a significant issue.   Or maybe there's another kind of update that would make
things work.  

> improve generics for UIMA indexes and iterators
> -----------------------------------------------
>
>                 Key: UIMA-4299
>                 URL: https://issues.apache.org/jira/browse/UIMA-4299
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>    Affects Versions: 2.7.0SDK
>            Reporter: Marshall Schor
>            Priority: Minor
>             Fix For: 2.7.1SDK
>
>
> When the JCas is being used, there are Java classes for UIMA types.  
> Each index definition is associated with a top-most type in the type hierarchy.
> Indexes are used to create iterators of various kinds; some of these iterators are defined
within classes which implement Iterable.  
> Add generic mechanisms to the Indexes and iterators to support Iterables whose elements
are JCas types. 
> Update the APIs that get indexes over particular types to allow specifying those types
by the type class, and use this for generic typing, so casts are not necessary for user code.
> Make the generics work also when JCas is not in use.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message