E - The type of object the BloomFilter should containpublic class CountingBloomFilter<E> extends Object implements Set<E>, Serializable
| Constructor and Description |
|---|
CountingBloomFilter(int expectedElements,
int[] intSet)
Constructs a CountingBloomFilter out of existing data.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
boolean |
addAll(Collection<? extends E> c) |
int |
approximateCount(E key)
Returns the number of times that an element has been added.
|
void |
clear()
Clear the Bloom Filter
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
int |
expectedElements()
Returns the expected elements that was provided by the user.
|
double |
expectedFalsePositiveProbability()
Calculates the approximate probability of the contains() method returning true for an object that had not
previously been inserted into the bloom filter.
|
int |
hashCode() |
int[] |
intSet()
Returns the bitset that backs the bloom filter
|
boolean |
isEmpty()
Not implemented
|
Iterator<E> |
iterator()
Not implemented
|
boolean |
remove(Object o)
Not implemented
|
boolean |
removeAll(Collection<?> c)
Not implemented
|
boolean |
retainAll(Collection<?> c)
Not implemented
|
int |
size()
Not implemented
|
Object[] |
toArray()
Not implemented
|
<T> T[] |
toArray(T[] a)
Not implemented
|
String |
toString() |
public CountingBloomFilter(int expectedElements,
int[] intSet)
expectedElements - he typical number of items you expect to be added to the CountingBloomFilter (often called 'n').intSet - The data that will be used in the backing BitSetpublic double expectedFalsePositiveProbability()
public int expectedElements()
public boolean add(E o)
public boolean addAll(Collection<? extends E> c)
public void clear()
public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>o - The object to comparepublic boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>c - The collection to check if its inside this bloom filterpublic boolean isEmpty()
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public int[] intSet()
public int approximateCount(E key)
key - The key to countpublic boolean equals(Object obj)
public int hashCode()
Copyright © 2014. All rights reserved.