Package one.microstream.hashing
Class XHashing
- java.lang.Object
-
- one.microstream.hashing.XHashing
-
public final class XHashing extends Object
Utility methods related to hashing.
-
-
Constructor Summary
Constructors Constructor Description XHashing()
-
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 Detail
-
hashEqualityIdentity
public static final <E> HashEqualator<E> hashEqualityIdentity()
-
hashEqualityValue
public static final <E> HashEqualator<E> 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.- Parameters:
hashEqualator
- single elementHashEqualator
instance to be wrapped.- Returns:
- the passed instance as a
KeyValue
HashEqualator
instance.
-
deriveHashEquality
public static final <E> HashEqualator<E> deriveHashEquality(Class<E> type)
-
-