moremore0812 / cqengine

Automatically exported from code.google.com/p/cqengine
0 stars 0 forks source link

Attribute#getValues to return Iterable #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Type-Enhancement

Please consider changing Attribute#getValues so it return Iterable, not List
As I can see, in most cases Iterable would be enough.

Original issue reported on code.google.com by g...@inbox.ru on 17 Dec 2014 at 1:09

GoogleCodeExporter commented 9 years ago
Thanks, good suggestion. Fixed in trunk.

Originally (pre-release versions of) CQEngine did use Iterable here. The reason 
for requiring List was the algorithm in TupleCombinationGenerator (used by 
CompoundIndex). Most literature talks of Lists :) But on revisiting it today, 
the inner lists can actually be Iterable, so it was easier than expected to 
refactor.

Indeed this change can provide more flexibility and performance improvements in 
applications.

These changes are backward compatible with existing attributes at source code 
level, but they are not backward compatible with already-compiled attributes.

When applications upgrade to the next release of the library, existing 
attributes will need to be recompiled against the new Attribute interface; 
however no actual code changes in the attribute source will be necessary.

The changes are in trunk, but I will leave this issue open until the next 
release is out.

Original comment by ni...@npgall.com on 17 Dec 2014 at 6:20