create

public static BloomFilter<T> create<T>(Funnel<T> funnel, long capacity, double fpp)

Creates a BloomFilter with the expected number of insertions and expected false positive probability.

Note that overflowing a BloomFilter with significantly more elements than specified, will result in its saturation, and a sharp deterioration of its false positive probability.

The constructed BloomFilter will be serializable if the provided Funnel is.

It is recommended that the funnel be implemented as a Java enum. This has the benefit of ensuring proper serialization and deserialization, which is important since equals also relies on object identity of funnels.

Return

a BloomFilter

Parameters

funnel

the funnel of T's that the constructed BloomFilter will use

capacity

the number of expected insertions to the constructed BloomFilter; must be positive

fpp

the desired false positive probability (must be positive and less than 1.0)

See also

<a target="guavadoc" href="http://google.github.io/guava/releases/snapshot/api/docs/com/google/common/hash/BloomFilter.html#create(com.google.common.hash.Funnel,

int, double)">com.google.common.hash.BloomFilter#create(com.google.common.hash.Funnel, int, double)


public static BloomFilter<T> create<T>(Funnel<T> funnel, long capacity)

Creates a BloomFilter with the expected number of insertions and a default expected false positive probability of 3%.

Note that overflowing a BloomFilter with significantly more objects than specified, will result in its saturation, and a sharp deterioration of its false positive probability.

The constructed BloomFilter will be serializable if the provided Funnel<T> is.

It is recommended that the funnel be implemented as a Java enum. This has the benefit of ensuring proper serialization and deserialization, which is important since equals also relies on object identity of funnels.

Return

a BloomFilter

Parameters

funnel

the funnel of T's that the constructed BloomFilter will use

capacity

the number of expected insertions to the constructed BloomFilter; must be positive

See also

<a target="guavadoc" href="http://google.github.io/guava/releases/snapshot/api/docs/com/google/common/hash/BloomFilter.html#create(com.google.common.hash.Funnel,

int)">com.google.common.hash.BloomFilter#create(com.google.common.hash.Funnel, int)