public class Hash extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Hash.HashType
Available Hashing techniques
|
Constructor and Description |
---|
Hash() |
Modifier and Type | Method and Description |
---|---|
static byte |
expHash(int x)
Compute exponentially distributed hash values in range 0..a.length
eg: 50% == 0 , 25% == 1 12.5 % == 2 etc.
|
static int |
hash(double o,
Hash.HashType ht)
Hash functions for double values.
|
static int |
hash(Object o,
Hash.HashType ht)
Generic hashing of java objects, not ideal for specific values so use the specific methods for specific types.
|
static int |
linearHash(int v)
Compute the Linear hash of an int input value.
|
static int |
linearHash(int v,
int bits)
Compute the Linear hash of an int input value, but only use the first bits of the linear hash.
|
public static int hash(Object o, Hash.HashType ht)
o
- The Object to hash.ht
- The HashType to use.public static int hash(double o, Hash.HashType ht)
o
- The double value.ht
- The hashing function to apply.public static int linearHash(int v)
v
- The value to hash.public static int linearHash(int v, int bits)
v
- The value to hash.bits
- The number of bits to use. up to maximum of 32.public static byte expHash(int x)
x
- value to hashCopyright © 2020 The Apache Software Foundation. All rights reserved.