package org.minperf.bloom;

public interface Filter {

    boolean mayContain(long key);
    long getBitCount();

    enum Type {
        CUCKOO16_4 {
            @Override
            Filter construct(long[] keys, int setting) {
                return CuckooFilter_16bit_4entries.construct(keys);
            }
        },
        CUCKOO8_4 {
            @Override
            Filter construct(long[] keys, int setting) {
                return CuckooFilter_8bit_4entries.construct(keys);
            }
        },
        XOR8 {
            @Override
            Filter construct(long[] keys, int setting) {
                return XorFilter_8bit.construct(keys);
            }
        },
        XOR16 {
            @Override
            Filter construct(long[] keys, int setting) {
                return XorFilter_16bit.construct(keys);
            }
        },
        BLOOM {
            @Override
            Filter construct(long[] keys, int setting) {
                return BloomFilter.construct(keys, setting);
            }
        },
        XOR {
            @Override
            Filter construct(long[] keys, int bitsPerKey) {
                return XorFilter.construct(keys, bitsPerKey);
            }
        },
        CUCKOO {
            @Override
            Filter construct(long[] keys, int setting) {
                return CuckooFilter.construct(keys, setting);
            }
        },
//        MPHF {
//            @Override
//            Filter construct(long[] keys, int setting) {
//                return MPHFilter.construct(keys, setting);
//            }
//        };
        ;

        /**
         * Construct the filter with the given keys and the setting.
         *
         * @param keys the keys
         * @param setting the setting (roughly bits per fingerprint)
         * @return the constructed filter
         */
        abstract Filter construct(long[] keys, int setting);

    }

}

@@ -111,16 +111,23 @@
 );%0A%0A    
+public 
 enum Typ
@@ -142,18 +142,12 @@
     
-CUCKOO16_4
+XOR8
  %7B%0A 
@@ -171,32 +171,39 @@
 ide%0A            
+public 
 Filter construct
@@ -258,35 +258,22 @@
 urn 
-Cuckoo
+Xor
 Filter_
-16
+8
 bit
-_4entries
 .con
@@ -323,17 +323,13 @@
     
-CUCKOO8_4
+BLOOM
  %7B%0A 
@@ -353,32 +353,39 @@
 ide%0A            
+public 
 Filter construct
@@ -440,34 +440,19 @@
 urn 
-Cuck
+Bl
 oo
+m
 Filter
-_8bit_4entries
 .con
@@ -454,32 +454,41 @@
 r.construct(keys
+, setting
 );%0A            %7D
@@ -499,36 +499,42 @@
      %7D,%0A        
-XOR8
+CUCKOO16_4
  %7B%0A            @
@@ -546,32 +546,39 @@
 ide%0A            
+public 
 Filter construct
@@ -625,38 +625,51 @@
      return 
-Xor
+Cuckoo
 Filter_
-8
+16
 bit
+_4entries
 .construct(k
@@ -711,13 +711,17 @@
     
-XOR16
+CUCKOO8_4
  %7B%0A 
@@ -745,32 +745,39 @@
 ide%0A            
+public 
 Filter construct
@@ -832,23 +832,34 @@
 urn 
-Xor
+Cuckoo
 Filter_
-16
+8
 bit
+_4entries
 .con
@@ -897,37 +897,37 @@
      %7D,%0A        
-BLOOM
+XOR16
  %7B%0A            @
@@ -939,32 +939,39 @@
 ide%0A            
+public 
 Filter construct
@@ -1018,35 +1018,39 @@
      return 
-Bloom
+Xor
 Filter
+_16bit
 .construct(k
@@ -1048,33 +1048,24 @@
 nstruct(keys
-, setting
 );%0A         
@@ -1120,32 +1120,39 @@
 ide%0A            
+public 
 Filter construct
@@ -1313,32 +1313,39 @@
 ide%0A            
+public 
 Filter construct
@@ -1916,16 +1916,23 @@
         
+public 
 abstract

Allow tests in different packages