Claudenw commented on pull request #258:
URL: 
https://github.com/apache/commons-collections/pull/258#issuecomment-996018958


   `IsSparse` is defined by the implementation.  SimpleBloomFilter is not 
sparse, SparseBloomFilter is (as is the Counting implementation).  As you 
deduced, comes down to which is more efficient for the filter to produce a 
"collecton" of indices (sparse) or a collection of BitMaps.
   
   The default `contains` implementation makes the assumption that if I am 
sparse then I can more easily process indices rather than BitMaps and visa 
versa.   If we ensure a rapid `cardinality()` check then it would make sense to 
use the method favoured by the higher cardinality filter.   Whether we use 
`this.isSparse()` or `other.isSparse()` probably does not make a lot of 
difference since I expect that most filters will be of the same type.  (perhaps 
there is a better name for `isSparse` but I don't know what it is.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to