Claudenw commented on pull request #258: URL: https://github.com/apache/commons-collections/pull/258#issuecomment-996890015
@garydgregory The `IndexProducer` and `BitMapProducer` are mechanisms to expose a common view of Bloom filters (a collection of indexes and a collections of BitMap -- or bit packed -- longs respectively) without forcing the implementation to actually produce one or the other. Any implementation of Bloom filter will need to implement the interfaces. There are helper methods/classes in the `IndexProducer` and `BitMapProducer` classes to produce one from the other. Rather than creating large arrays of indexes or BitMaps these interfaces hava a `forEachIndex( IntPredicate )` and `forEachBitMap( LongPredicate )` method respectively. Formerly these methods took `IntConsumer` and `LongConsumer` arguments. The guarantee is that they will apply the predicate to each item in the collection until there the predicate returns false, or there are no more items. This architecture allows classes like the `ArrayCountingBloomFilter` implementation to be merged into a standard Bloom filter implementation without issue as it implements both Producers and the Bloom filter merge method operates on them. IndexProducer is also the interface that `Hashers` producer via their `indices(Shape)` method. So adding more items to a bloom filter is as simple as merging the `Hasher.indices()` using the Shape of the associated with the Bloom filter itself. I never considered them as streams, but I can see how the nomenclature could be confusing. -- 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: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org