Constructor and Description |
---|
BloomFilter(int n)
Create a bloom filter of 1Mib.
|
BloomFilter(int n,
int m)
Create a new bloom filter.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Object o)
Add an element to the container
|
void |
clear()
Removes all of the elements from this filter.
|
BloomFilter |
clone()
Create a copy of the current filter
|
boolean |
contains(Object o)
Returns true if the element is in the container.
|
boolean |
equals(BloomFilter other)
Test if the filters have equal bitsets.
|
int |
hashCode()
Generate a unique hash representing the filter
|
void |
merge(BloomFilter other)
Merge another bloom filter into the current one.
|
public BloomFilter(int n, int m)
n
- Expected number of elementsm
- Desired size of the container in bitspublic BloomFilter(int n)
n
- Expected number of elementspublic void add(Object o)
public boolean contains(Object o)
public void clear()
public BloomFilter clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public int hashCode()
public boolean equals(BloomFilter other)
public void merge(BloomFilter other)
Copyright © 2017. All rights reserved.