[
https://issues.apache.org/jira/browse/UIMA-5115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15533169#comment-15533169
]
Marshall Schor commented on UIMA-5115:
--------------------------------------
uimaFIT has a param for following/preceding that limits the number of
annotations returned.
The general "positioning" alternatives include a FS, begin/end, and those two
plus a possible "offset". These seem to possibly confict when designing APIs.
(offset(n) here means after positioning the iterator to some start position,
before starting, do "n" moveToPrevious/Next() operations).
I tend to think that limit(n) is more popular than offset(n); if so, perhaps we
should offer it the optional positional parameter spot uniformly in all the API
variants instead of offset?
Examples:
{code}
cas.select(MyType.class).startAt(begin, end, limit).offset(3) // limit is
(optional) positional, offset via keyword
cas.select(MyType.class).startAt(begin, end, offset).limit(4) // offset is
(optional) positional, limit via keyword
cas.select(MyType.class).following(begin, end, limit).offset(3) // limit is
(optional) positional, offset via keyword
cas.select(MyType.class).following(begin, end, offset).limit(4) // offset is
(optional) positional, limit via keyword
{code}
Other ideas or preferences? I don't have a strong preference, except I'm
slightly in favor of being consistent.
* The inconsistent approach would be to have it one way for, say,, coveredBy,
and the other way for following.
> 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
(v6.3.4#6332)