Andrea Aime wrote:
>> Perfect! This is exactly the kind of thing I was hoping for as we set 
>> up FeatureList.
>>
>> FeatureCollection.sort( SortBy ).iterator() should give you a "sorted 
>> writer". The iterator should let you work over top of a sorted result 
>> set :-)
> I have a preference for working against FeatureReader and FeatureWriter
> because they're simpler and more predictable imho, so I would really
> like a public DataStore call that sounds like:
And I am trying to kill these things as a mistake :-( That is they are 
too low level, useful for implementing, but not so much to work against 
(they throw too many exceptions and do not follow the collections api).

> FeatureWriter getFeatureWriter(String typeName, Filter filter, 
> SortBy[], Transaction transaction)
You are welcome to add that to your DataStore, I ask that you out the 
ability as the backing of FeatureList if you don't mind.
> In the end, I believe we need the same thing, since to implement 
> FeatureList you need the datastore to provide you some way to sort 
> writers, no?
You are correct we need something like this, but I have provided no help 
as part of AbstractDataStore for implementors at this time.
> Oh, btw, you said FeatureCollection.sort( SortBy ).iterator() gives me
> a sorted writer? You do mean that every time I do call next() a call
> to write() against the wrapped writer is implied?
You asked about API, yes this is the way to get a sorted iterator that 
can do read or write. The code copies
the feature, and when next is called it looks if anything was modified, 
and if so does a write.  Iterators have been provided around both 
FeatureReader and FeatureWriter, so if you can *know* your user is not 
doing any writing you
can use the faster one with no checks.  ie DataStore.getView( Filter 
).sort( SortBy ).iterator() is readonly ....
> Moreover, the (nicer imho) FeatureIterator does not have a remove() 
> call, we should add it then?
FeatureIterator literally is just a hack to get around our lack of Java 
5, it should extend Iterator<Feature>, so if you want to make one that 
extends ListIterator<Feature> (I think that is where remove comes from?) 
then that would also be cool.

Cheers,
Jody

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to