public class PunchBloomFilter<T> extends Object
What it adds it to generate a json representation in which the bits (typically large) is compressed and base64 encoded.
Constructor and Description |
---|
PunchBloomFilter(int expectedInsertions,
double fpp)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Add an element
|
String |
asJson() |
static PunchBloomFilter<String> |
buildFromString(String s) |
boolean |
contains(T element) |
public PunchBloomFilter(int expectedInsertions, double fpp)
expectedInsertions
- the expected number of insertionsfpp
- the false positive probabilitypublic static PunchBloomFilter<String> buildFromString(String s)
s
- a serialized bloom filterpublic String asJson()
public boolean contains(T element)
element
- the element to check forpublic void add(T element)
element
- the element to addCopyright © 2023. All rights reserved.