-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new bloom filter class specifically for 160bit arrays, in our case sh…
…a1 hashes.
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* ---------------------------------------------------------------------------- | ||
* This file was automatically generated by SWIG (http://www.swig.org). | ||
* Version 3.0.4 | ||
* | ||
* Do not make changes to this file unless you know what you are doing--modify | ||
* the SWIG interface file instead. | ||
* ----------------------------------------------------------------------------- */ | ||
|
||
package com.frostwire.jlibtorrent.swig; | ||
|
||
public class sha1_bloom_filter { | ||
private long swigCPtr; | ||
protected boolean swigCMemOwn; | ||
|
||
protected sha1_bloom_filter(long cPtr, boolean cMemoryOwn) { | ||
swigCMemOwn = cMemoryOwn; | ||
swigCPtr = cPtr; | ||
} | ||
|
||
protected static long getCPtr(sha1_bloom_filter obj) { | ||
return (obj == null) ? 0 : obj.swigCPtr; | ||
} | ||
|
||
protected void finalize() { | ||
delete(); | ||
} | ||
|
||
public synchronized void delete() { | ||
if (swigCPtr != 0) { | ||
if (swigCMemOwn) { | ||
swigCMemOwn = false; | ||
libtorrent_jni.delete_sha1_bloom_filter(swigCPtr); | ||
} | ||
swigCPtr = 0; | ||
} | ||
} | ||
|
||
public boolean find(sha1_hash k) { | ||
return libtorrent_jni.sha1_bloom_filter_find(swigCPtr, this, sha1_hash.getCPtr(k), k); | ||
} | ||
|
||
public void set(sha1_hash k) { | ||
libtorrent_jni.sha1_bloom_filter_set(swigCPtr, this, sha1_hash.getCPtr(k), k); | ||
} | ||
|
||
public String to_string() { | ||
return libtorrent_jni.sha1_bloom_filter_to_string(swigCPtr, this); | ||
} | ||
|
||
public void from_string(String str) { | ||
libtorrent_jni.sha1_bloom_filter_from_string(swigCPtr, this, str); | ||
} | ||
|
||
public void clear() { | ||
libtorrent_jni.sha1_bloom_filter_clear(swigCPtr, this); | ||
} | ||
|
||
public float size() { | ||
return libtorrent_jni.sha1_bloom_filter_size(swigCPtr, this); | ||
} | ||
|
||
public sha1_bloom_filter() { | ||
this(libtorrent_jni.new_sha1_bloom_filter(), true); | ||
} | ||
|
||
} |