Richard Eckart de Castilho commented on UIMA-5115:

I imagine this scenario:

* I have a type descriptor XML which declares Token as a subtype of Annotation
* I did not generate JCas classes for Token

So now the question is, which of the following signatures we should prefer:

1 | Annotation t = (Annotation) cas.select("my.Token").at(0, 2).get(); // were 
get() returns FeatureStructure
2 | Annotation t = cas.select("my.Token").at(0, 2).get() // where the return 
type of get() is inferred by the type of t
3 | Annotation t = cas.select("my.Token", Annotation.class).at(0, 2).get() // 
where the return type of get() is inferred by the second arg of select

I think 1 is not desirable. In most cases people will have to cast to 
Annotation because it is more common to work with annotations than with plain 
features structures. So I would argue the question is between 2 and 3. I kind 
of tend towards 3...

> uv3 select() api for iterators and streams over CAS contents
> ------------------------------------------------------------
>                 Key: UIMA-5115
>                 URL: https://issues.apache.org/jira/browse/UIMA-5115
>             Project: UIMA
>          Issue Type: New Feature
>          Components: Core Java Framework
>            Reporter: Marshall Schor
>            Priority: Minor
>             Fix For: 3.0.0SDKexp
> Design and implement a select() API based on uimaFIT's select, integrated 
> well with Java 8 concepts.  Initial discussions in UIMA-1524.  Wiki with 
> diagram: https://cwiki.apache.org/confluence/display/UIMA/UV3+Iterator+support

This message was sent by Atlassian JIRA

Reply via email to