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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
    Maximal practical depth for differentiating keys.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    compare(K key1, K key2)
     
    default int
    getEffectiveHash(K key, int index)
     
    int
    getHash(K key, int index)
    Provides a hash code for a object key with a given index.
  • 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_DEPTH
      Maximal 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

      int getHash(K key, int index)
      Provides a hash code for a object key with a given index. It has the following contracts:
      • If
        invalid reference
        #equals
        (key1,key2), then getHash(key1, index) == getHash(key2, index) for all values of index.
      • If getHash(key1,index) == getHash(key2, index) for all values of index, then
        invalid reference
        #equals
        (key1, key2)
      • In current implementation, we use only the least significant EFFECTIVE_BITS
      Check
      invalid reference
      #equals
      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.
    • getEffectiveHash

      default int getEffectiveHash(K key, int index)
    • compare

      default int compare(K key1, K key2)