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

Marshall Schor commented on UIMA-5603:
--------------------------------------

The meaning of unordered is that the Framework makes no commitment to the 
ordering, and ordering should not be expected.  If the type is a subtype of 
Annotation, and there is no other sorted index defined for the type, the order 
(for the current impl) corresponds to something like this:
1) there's no interleaving of types and subtypes, like a real iterator would
2) for each type or subtype, it currently is in the sorted order (for the 
Annotation index) (but just for that type, not including the subtypes)

Saying it is unordered is meant to discourage users from depending on the 
order.  And, given that a pipeline assembler could add an index definition 
using XML configuration, which the programmer would not know about, it would be 
quite unreliable to depend on an order.  If an order is wanted for a particular 
type and index, programmers wanting that order must specify the type and index 
to get that index, and then can use the extended-for on that index, or get an 
interator, from that index, etc.

> uv3 add ability to do extended-for on all FSs of a type in a view
> -----------------------------------------------------------------
>
>                 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).  
> Add a new set of methods, getIndexedFSs( Type or JCas.class or nothing) to 
> CAS/JCas and FSIndexRepository interfaces, that return Collections, without 
> copying the index arrays, but just using them.  Make these copy-on-write 
> style, so subsequent updates to the UIMA indexes won't affect the collection. 
>  These can then be used in extended-for loops.
> Update internal uses of getAllIndexedFS (which does copy the indexes) to use 
> the new style.



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

Reply via email to