Package | Description |
---|---|
com.google.common.hash |
Hash functions and related structures.
|
Modifier and Type | Class and Description |
---|---|
private static class |
Funnels.ByteArrayFunnel |
private static class |
Funnels.IntegerFunnel |
private static class |
Funnels.LongFunnel |
private static class |
Funnels.SequentialFunnel<E> |
private static class |
Funnels.StringCharsetFunnel |
private static class |
Funnels.UnencodedCharsFunnel |
Modifier and Type | Field and Description |
---|---|
private Funnel<E> |
Funnels.SequentialFunnel.elementFunnel |
private Funnel<? super T> |
BloomFilter.funnel
The funnel to translate Ts to bytes
|
(package private) Funnel<? super T> |
BloomFilter.SerialForm.funnel |
Modifier and Type | Method and Description |
---|---|
static Funnel<byte[]> |
Funnels.byteArrayFunnel()
Returns a funnel that extracts the bytes from a
byte array. |
static Funnel<java.lang.Integer> |
Funnels.integerFunnel()
Returns a funnel for integers.
|
static Funnel<java.lang.Long> |
Funnels.longFunnel()
Returns a funnel for longs.
|
static <E> Funnel<java.lang.Iterable<? extends E>> |
Funnels.sequentialFunnel(Funnel<E> elementFunnel)
Returns a funnel that processes an
Iterable by funneling its elements in iteration
order with the specified funnel. |
static Funnel<java.lang.CharSequence> |
Funnels.stringFunnel(java.nio.charset.Charset charset)
Returns a funnel that encodes the characters of a
CharSequence with the specified
Charset . |
static Funnel<java.lang.CharSequence> |
Funnels.unencodedCharsFunnel()
Returns a funnel that extracts the characters from a
CharSequence , a character at a
time, without performing any encoding. |
Modifier and Type | Method and Description |
---|---|
static <T> BloomFilter<T> |
BloomFilter.create(Funnel<? super T> funnel,
int expectedInsertions)
Creates a
BloomFilter with the expected number of
insertions and a default expected false positive probability of 3%. |
static <T> BloomFilter<T> |
BloomFilter.create(Funnel<? super T> funnel,
int expectedInsertions,
double fpp)
Creates a
BloomFilter with the expected number of
insertions and expected false positive probability. |
(package private) static <T> BloomFilter<T> |
BloomFilter.create(Funnel<? super T> funnel,
int expectedInsertions,
double fpp,
BloomFilter.Strategy strategy) |
<T> HashCode |
HashFunction.hashObject(T instance,
Funnel<? super T> funnel)
Shortcut for
newHasher().putObject(instance, funnel).hash() . |
<T> HashCode |
AbstractStreamingHashFunction.hashObject(T instance,
Funnel<? super T> funnel) |
<T> HashCode |
AbstractNonStreamingHashFunction.hashObject(T instance,
Funnel<? super T> funnel) |
<T> boolean |
BloomFilter.Strategy.mightContain(T object,
Funnel<? super T> funnel,
int numHashFunctions,
BloomFilterStrategies.BitArray bits)
Queries
numHashFunctions bits of the given bit array, by hashing a user element;
returns true if and only if all selected bits are set. |
<T> boolean |
BloomFilter.Strategy.put(T object,
Funnel<? super T> funnel,
int numHashFunctions,
BloomFilterStrategies.BitArray bits)
Sets
numHashFunctions bits of the given bit array, by hashing a user element. |
<T> Hasher |
Hasher.putObject(T instance,
Funnel<? super T> funnel)
A simple convenience for
funnel.funnel(object, this) . |
<T> Hasher |
AbstractStreamingHashFunction.AbstractStreamingHasher.putObject(T instance,
Funnel<? super T> funnel) |
<T> Hasher |
AbstractNonStreamingHashFunction.BufferingHasher.putObject(T instance,
Funnel<? super T> funnel) |
<T> Hasher |
AbstractByteHasher.putObject(T instance,
Funnel<? super T> funnel) |
static <T> BloomFilter<T> |
BloomFilter.readFrom(java.io.InputStream in,
Funnel<T> funnel)
Reads a byte stream, which was written by BloomFilter.writeTo(OutputStream), into
a
BloomFilter<T> . |
static <E> Funnel<java.lang.Iterable<? extends E>> |
Funnels.sequentialFunnel(Funnel<E> elementFunnel)
Returns a funnel that processes an
Iterable by funneling its elements in iteration
order with the specified funnel. |
Constructor and Description |
---|
BloomFilter(BloomFilterStrategies.BitArray bits,
int numHashFunctions,
Funnel<? super T> funnel,
BloomFilter.Strategy strategy)
Creates a BloomFilter.
|
SequentialFunnel(Funnel<E> elementFunnel) |