Am 08.08.2013 um 20:33 schrieb Marshall Schor <[email protected]>:

> On 8/8/2013 12:06 PM, Richard Eckart de Castilho wrote:
>> The methods returned Iterable in earlier versions of uimaFIT, but the 
>> ability to
>> get the number of annotations of the selected type or to check if it was 
>> (non-)empty
>> was sufficiently common that it has been changed to Collection. 
> It's possible to have the method return a class which implements Iterable, and
> has the additional functions, of course; it would not need to implement 
> Collections.

I'd like to point out that the "destructive" methods of collections (basically 
those that
UIMA iterators currently don't work well with) are optional. Them throwing an 
UnsupportedOperationException is part of the Java Collection API. So departing 
from a
standard API may not be worth the removal of these optional signatures.


[1]: The "destructive" algorithms contained in this class, that is, the 
algorithms that modify the collection on which they operate, are specified to 
throw UnsupportedOperationException if the collection does not support the 
appropriate mutation primitive(s), such as the set method. 


I'm not convinced yet…

-- Richard

[1] http://docs.oracle.com/javase/6/docs/api/java/util/Collections.html 

Reply via email to