Claudenw commented on code in PR #258:
URL: 
https://github.com/apache/commons-collections/pull/258#discussion_r895020158


##########
src/main/java/org/apache/commons/collections4/bloomfilter/BloomFilter.java:
##########
@@ -16,138 +16,237 @@
  */
 package org.apache.commons.collections4.bloomfilter;
 
-import org.apache.commons.collections4.bloomfilter.hasher.Hasher;
-import org.apache.commons.collections4.bloomfilter.hasher.Shape;
-import org.apache.commons.collections4.bloomfilter.hasher.StaticHasher;
+import java.util.Objects;
 
 /**
  * The interface that describes a Bloom filter.
+ * <p>
+ * <em>See implementation notes for BitMapProducer and IndexProducer.</em>
+ * </p>
+ * @see BitMapProducer
+ * @see IndexProducer
  * @since 4.5
  */
-public interface BloomFilter {
-
-    // Query Operations
+public interface BloomFilter extends IndexProducer, BitMapProducer {
 
     /**
-     * Gets the shape of this filter.
-     *
-     * @return the shape of this filter
+     * Creates a new instance of the BloomFilter with the same properties as 
the current one.
+     * @return a copy of this BloomFilter
      */
-    Shape getShape();
+    BloomFilter copy();
+
+    // Query Operations
 
     /**
-     * Gets an array of little-endian long values representing the bits of 
this filter.
+     * This method is used to determine the best method for matching.
      *
-     * <p>The returned array will have length {@code ceil(m / 64)} where 
{@code m} is the
-     * number of bits in the filter and {@code ceil} is the ceiling function.
-     * Bits 0-63 are in the first long. A value of 1 at a bit position 
indicates the bit
-     * index is enabled.
+     * <p>For `sparse` implementations
+     * the {@code forEachIndex(IntConsumer consumer)} method is more 
efficient.  For non `sparse` implementations
+     * the {@code forEachBitMap(LongConsumer consumer)} is more efficient.  
Implementers should determine if it is easier
+     * for the implementation to produce indexes of bit map blocks.</p>
      *
-     * @return the {@code long[]} representation of this filter
+     * @return {@code true} if the implementation is sparse {@code false} 
otherwise.
+     * @see BitMap
      */
-    long[] getBits();
+    boolean isSparse();

Review Comment:
   Created https://issues.apache.org/jira/browse/COLLECTIONS-818 to cover this



-- 
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