uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eckart de Castilho (JIRA)" <...@uima.apache.org>
Subject [jira] [Comment Edited] (UIMA-5603) uv3 make FSIterator implement Iterable
Date Tue, 03 Oct 2017 22:04:00 GMT

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

Richard Eckart de Castilho edited comment on UIMA-5603 at 10/3/17 10:03 PM:
----------------------------------------------------------------------------

That should kind of work. I suppose iterators start from the beginning when obtained from
an iterable. A simple clone would start off whereever the iterator currently is. Also, it
would still be somewhat strange that something is simultaneously an iterator and an iterable.

Btw. in uimaFIT, I tried to return collections in such cases - they are not only iterable,
but also have a size() method (which admittedly is currently implemented a bit clumsily).
See FSIteratorAdapter.


was (Author: rec):
That should work. It would still be strange that something is simultaneously an iterator and
an iterable.

Btw. in uimaFIT, I tried to return collections in such cases - they are not only iterable,
but also have a size() method (which admittedly is currently implemented a bit clumsily).
See FSIteratorAdapter.

> uv3 make FSIterator implement Iterable
> --------------------------------------
>
>                 Key: UIMA-5603
>                 URL: https://issues.apache.org/jira/browse/UIMA-5603
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>    Affects Versions: 3.0.0SDK-alpha02
>            Reporter: Marshall Schor
>            Assignee: Marshall Schor
>            Priority: Trivial
>             Fix For: 3.0.0SDK-beta
>
>
> Forms like cas.getIndexRepository().getAllIndexedFSs(...) return an iterator.  It would
be nice to be able to use the returned result in an extended for :   for (TOP x : cas.getInd...
etc). Make FSIterator implement Iterable (returning itself, as a default method).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message