ProbabilisticFilter

public interface ProbabilisticFilter<E>

A probabilistic filter offers an approximate containment test with one-sided error: if it claims that an element is contained in it, this might be in error, but if it claims that an element is not contained in it, then this is definitely true.

The false positive probability (FPP) of a probabilistic filter is defined as the probability that contains will erroneously return true for an element that is not actually contained in the filter.

Author

Brian Dupras

Parameters

<E>

the type of elements that this filter accepts

See also

Inheritors

Functions

Link copied to clipboard
public abstract boolean add(E e)
Adds the specified element to this filter (optional operation).
Link copied to clipboard
public abstract boolean addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this filter (optional operation).
public abstract boolean addAll(ProbabilisticFilter<E> f)
Combines this filter with another compatible filter (optional operation).
Link copied to clipboard
public abstract long capacity()
Returns the number of elements this filter can represent at its requested FPP.
Link copied to clipboard
public abstract void clear()
Removes all of the elements from this filter (optional operation).
Link copied to clipboard
public abstract boolean contains(E e)
Returns true if this filter might contain the specified element, false if this is definitely not the case.
Link copied to clipboard
public abstract boolean containsAll(Collection<? extends E> c)
Returns true if this filter might contain all of the elements of the specified collection (optional operation).
public abstract boolean containsAll(ProbabilisticFilter<E> f)
Returns true if this filter might contain all elements contained in the specified filter (optional operation).
Link copied to clipboard
public abstract double currentFpp()
Returns the current false positive probability (FPP) of this filter.
Link copied to clipboard
public abstract double fpp()
Returns the intended FPP limit of this filter.
Link copied to clipboard
public abstract boolean isCompatible(ProbabilisticFilter<E> f)
Returns true if the specified filter is compatible with this filter.
Link copied to clipboard
public abstract boolean isEmpty()
Returns true if this filter contains no elements.
Link copied to clipboard
public abstract boolean remove(E e)
Removes the specified element from this filter (optional operation).
Link copied to clipboard
public abstract boolean removeAll(Collection<? extends E> c)
Removes from this filter all of its elements that are contained in the specified collection (optional operation).
public abstract boolean removeAll(ProbabilisticFilter<E> f)
Subtracts the specified filter from this filter.
Link copied to clipboard
public abstract long size()
Returns the number of elements contained in this filter (its cardinality).
Link copied to clipboard
public abstract long sizeLong()
Returns the number of elements contained in this filter (its cardinality).