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
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Maximal 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 objectkey
with a givenindex
. It has the following contracts:- If
invalid reference
#equals
(key1,key2)
, thengetHash(key1, index) == getHash(key2, index)
for all values ofindex
. - If
getHash(key1,index) == getHash(key2, index)
for all values ofindex
, theninvalid reference
#equals
(key1, key2)
- In current implementation, we use only the least significant
EFFECTIVE_BITS
invalid reference
#equals
- 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
-