Package com.google.common.hash
Interface BloomFilter.Strategy
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
BloomFilterStrategies
- Enclosing class:
- BloomFilter<T>
static interface BloomFilter.Strategy extends java.io.Serializable
A strategy to translate T instances, tonumHashFunctions
bit indexes.Implementations should be collections of pure functions (i.e. stateless).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> boolean
mightContain(T object, Funnel<? super T> funnel, int numHashFunctions, BloomFilterStrategies.LockFreeBitArray bits)
QueriesnumHashFunctions
bits of the given bit array, by hashing a user element; returnstrue
if and only if all selected bits are set.int
ordinal()
Identifier used to encode this strategy, when marshalled as part of a BloomFilter.<T> boolean
put(T object, Funnel<? super T> funnel, int numHashFunctions, BloomFilterStrategies.LockFreeBitArray bits)
SetsnumHashFunctions
bits of the given bit array, by hashing a user element.
-
-
-
Method Detail
-
put
<T> boolean put(T object, Funnel<? super T> funnel, int numHashFunctions, BloomFilterStrategies.LockFreeBitArray bits)
SetsnumHashFunctions
bits of the given bit array, by hashing a user element.Returns whether any bits changed as a result of this operation.
-
mightContain
<T> boolean mightContain(T object, Funnel<? super T> funnel, int numHashFunctions, BloomFilterStrategies.LockFreeBitArray bits)
QueriesnumHashFunctions
bits of the given bit array, by hashing a user element; returnstrue
if and only if all selected bits are set.
-
ordinal
int ordinal()
Identifier used to encode this strategy, when marshalled as part of a BloomFilter. Only values in the [-128, 127] range are valid for the compact serial form. Non-negative values are reserved for enums defined in BloomFilterStrategies; negative values are reserved for any custom, stateful strategy we may define (e.g. any kind of strategy that would depend on user input).
-
-