Package tools.refinery.store.map
Interface ContinuousHashProvider<K>
- Type Parameters:
K- Target java type.
- All Known Implementing Classes:
TupleHashProvider
public interface ContinuousHashProvider<K>
A class representing an equivalence relation for a type
K with a
continuous hash function.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intMaximal practical depth for differentiating keys. -
Method Summary
-
Field Details
-
EFFECTIVE_BITS
static final int EFFECTIVE_BITS- See Also:
-
EFFECTIVE_BIT_MASK
static final int EFFECTIVE_BIT_MASK- See Also:
-
MAX_PRACTICAL_DEPTH
static final int MAX_PRACTICAL_DEPTHMaximal practical depth for differentiating keys. If two keys have the same hash code until that depth, the algorithm can stop.- See Also:
-
-
Method Details
-
getHash
Provides a hash code for a objectkeywith a givenindex. It has the following contracts:- If
equals(key1, key2), thengetHash(key1, index) == getHash(key2, index)for all values ofindex. - If
getHash(key1,index) == getHash(key2, index)for all values ofindex, thenequals(key1, key2) - In current implementation, we use only the least significant
EFFECTIVE_BITS
Object.equals(Object)for further details.- Parameters:
key- The target data object.index- The depth of the hash code. Needs to be non-negative.- Returns:
- A hash code.
- If
-
getEffectiveHash
-
compare
-