Package one.microstream.hashing
Class XHashing
java.lang.Object
one.microstream.hashing.XHashing
public final class XHashing extends Object
Utility methods related to hashing.
-
Method Summary
Modifier and Type Method Description static int
calculateHashLength(long desiredCapacity, float hashDensity)
static <E> HashEqualator<E>
deriveHashEquality(Class<E> type)
static <E> HashEqualator<E>
hashEqualityIdentity()
static <E> HashEqualator<E>
hashEqualityValue()
static boolean
isValidHashDensity(float hashDensity)
static <KV extends KeyValue<?, ?>>
HashEqualator<KV>keyValueHashEqualityKeyIdentity()
static int
padHashLength(long desiredHashLength)
static float
validateHashDensity(float hashDensity)
static <K, V> HashEqualator<KeyValue<K,V>>
wrapAsKeyValue(HashEqualator<? super K> hashEqualator)
Wrappers the passedHashEqualator
instance as aKeyValue
HashEqualator
instance, using theKeyValue
instance's key as the hash element.
-
Method Details
-
hashEqualityIdentity
-
hashEqualityValue
-
keyValueHashEqualityKeyIdentity
public static final <KV extends KeyValue<?, ?>> HashEqualator<KV> keyValueHashEqualityKeyIdentity() -
calculateHashLength
public static final int calculateHashLength(long desiredCapacity, float hashDensity) -
padHashLength
public static final int padHashLength(long desiredHashLength) -
isValidHashDensity
public static final boolean isValidHashDensity(float hashDensity) -
validateHashDensity
public static final float validateHashDensity(float hashDensity) -
wrapAsKeyValue
public static final <K, V> HashEqualator<KeyValue<K,V>> wrapAsKeyValue(HashEqualator<? super K> hashEqualator)Wrappers the passedHashEqualator
instance as aKeyValue
HashEqualator
instance, using theKeyValue
instance's key as the hash element.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
hashEqualator
- single elementHashEqualator
instance to be wrapped.- Returns:
- the passed instance as a
KeyValue
HashEqualator
instance.
-
deriveHashEquality
-