You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/09/25 17:50:49 UTC

[GitHub] [commons-collections] Claudenw commented on a change in pull request #83: WIP: Initial bloom filter code contribution

Claudenw commented on a change in pull request #83: WIP: Initial bloom filter code contribution
URL: https://github.com/apache/commons-collections/pull/83#discussion_r328257838
 
 

 ##########
 File path: src/main/java/org/apache/commons/collections4/bloomfilters/BloomFilter.java
 ##########
 @@ -39,23 +48,39 @@
 	/**
 	 * Constructor.
 	 * 
-	 * A copy of the bitSet parameter is made so that the bloom filter
-	 * is isolated from any further changes in the bitSet.
+	 * @param protoFilter the protoFilter to build this bloom filter from.
+	 * @param config the Filter configuration to use to build the bloom filter.
+	 */
+	public BloomFilter(ProtoBloomFilter protoFilter, FilterConfig config) {
+		this.bitSet = new BitSet(config.getNumberOfBits());
+		for (Hash hash : protoFilter.hashes) {
+			hash.populate(bitSet, config);
+		}		
+		this.hamming = null;
+		this.logValue = null;
+	}
+	
+	/**
+	 * Constructor.
+	 * 
+	 * A copy of the bitSet parameter is made so that the bloom filter is isolated
+	 * from any further changes in the bitSet.
 	 * 
 	 * @param bitSet The bit set that was built by the config.
 	 */
-	public BloomFilter(BitSet bitSet) {
+	protected BloomFilter(BitSet bitSet)
+	{
 
 Review comment:
   done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services