Package com.google.common.hash
Interface BloomFilter.Strategy
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BloomFilterStrategies
- Enclosing class:
BloomFilter<T>
A strategy to translate T instances, to
numHashFunctions
bit indexes.
Implementations should be collections of pure functions (i.e. stateless).
-
Method Summary
Modifier and TypeMethodDescription<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 Details
-
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).
-