/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.1
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package btllib;

public class BloomFilter {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected BloomFilter(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(BloomFilter obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        btllibJNI.delete_BloomFilter(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public BloomFilter() {
    this(btllibJNI.new_BloomFilter__SWIG_0(), true);
  }

  public BloomFilter(long bytes, long hash_num) {
    this(btllibJNI.new_BloomFilter__SWIG_1(bytes, hash_num), true);
  }

  public BloomFilter(String path) {
    this(btllibJNI.new_BloomFilter__SWIG_2(path), true);
  }

  public void insert(SWIGTYPE_p_std__vectorT_uint64_t_t hashes) {
    btllibJNI.BloomFilter_insert__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__vectorT_uint64_t_t.getCPtr(hashes));
  }

  public void insert(SWIGTYPE_p_uint64_t hashes) {
    btllibJNI.BloomFilter_insert__SWIG_1(swigCPtr, this, SWIGTYPE_p_uint64_t.getCPtr(hashes));
  }

  public boolean contains(SWIGTYPE_p_std__vectorT_uint64_t_t hashes) {
    return btllibJNI.BloomFilter_contains__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__vectorT_uint64_t_t.getCPtr(hashes));
  }

  public boolean contains(SWIGTYPE_p_uint64_t hashes) {
    return btllibJNI.BloomFilter_contains__SWIG_1(swigCPtr, this, SWIGTYPE_p_uint64_t.getCPtr(hashes));
  }

  public long get_bytes() {
    return btllibJNI.BloomFilter_get_bytes(swigCPtr, this);
  }

  public SWIGTYPE_p_uint64_t get_pop_cnt() {
    return new SWIGTYPE_p_uint64_t(btllibJNI.BloomFilter_get_pop_cnt(swigCPtr, this), true);
  }

  public long get_hash_num() {
    return btllibJNI.BloomFilter_get_hash_num(swigCPtr, this);
  }

  public double get_fpr() {
    return btllibJNI.BloomFilter_get_fpr(swigCPtr, this);
  }

  public void write(String path) {
    btllibJNI.BloomFilter_write(swigCPtr, this, path);
  }

}
