title: integrate Choco and Bloom filter
body: <p>Now I am going to integrate Choco and bloom filter. The problem is I want to know which JAVA file in Choco is about search process because I want to store the decisions of each nodes into bloom filter after each searching step.</p>
  
  <p>source code of choco: <a href="https://github.com/chocoteam/choco-solver" rel="nofollow">https://github.com/chocoteam/choco-solver</a></p>
  
  <p>source code of bloom filter:
  import java.util.BitSet;<br>
  public class BloomFilter {  </p>
  
  <pre><code>private static final int DEFAULT_SIZE = 2 &lt;&lt; 24;
  private static final int[] seeds = {3,5,7, 11, 13, 31, 37, 61};
  private static BitSet bits = new BitSet(DEFAULT_SIZE);  
  private static SimpleHash[] func = new SimpleHash[seeds.length];  
  
  public static void addValue(String value)  
  {  
      for(SimpleHash f : func)
          bits.set(f.hash(value),true);  
  }  
  
  public static void add(String value)  
  {  
      if(value != null) addValue(value);  
  }  
  
  public static boolean contains(String value)  
  {  
      if(value == null) return false;  
      boolean ret = true;  
      for(SimpleHash f : func)
          ret = ret &amp;&amp; bits.get(f.hash(value));  
      return ret;  
  }  
  
  public static void main(String[] args) {  
      String value = "xkeyideal@gmail.com";  
      for (int i = 0; i &lt; seeds.length; i++) {  
          func[i] = new SimpleHash(DEFAULT_SIZE, seeds[i]);  
      }  
      add(value);  
      System.out.println(contains(value));  
  }  
  </code></pre>
  
  <p>}  </p>
  
  <p>class SimpleHash {  </p>
  
  <pre><code>private int cap;  
  private int seed;  
  
  public  SimpleHash(int cap, int seed) {  
      this.cap = cap;  
      this.seed = seed;  
  }  
  
  public int hash(String value) 
      int result = 0;  
      int len = value.length();  
      for (int i = 0; i &lt; len; i++) {  
          result = seed * result + value.charAt(i);  
      }  
      return (cap - 1) &amp; result;  
  }  
  </code></pre>
  
  <p>}  </p>