Class ModuloHashTable<T>

java.lang.Object
org.hibernate.search.util.common.data.impl.HashTable<T>
org.hibernate.search.util.common.data.impl.ModuloHashTable<T>
Type Parameters:
T - The type of elements stored in each bucket.
All Implemented Interfaces:
Iterable<T>

public final class ModuloHashTable<T> extends HashTable<T>
A hash table that applies a modulo operation to the hash in order to turn it into an index.
  • Constructor Details

    • ModuloHashTable

      public ModuloHashTable(HashFunction hashFunction, int size)
  • Method Details

    • computeIndex

      public int computeIndex(CharSequence key)
      Description copied from class: HashTable
      Hashes a key and computes an array index based on that hash.

      The maximum index is defined by constructor parameters passed to the hash function.

      Specified by:
      computeIndex in class HashTable<T>
      Parameters:
      key - A key to hash in order to compute an index.
      Returns:
      The index to use for the given key in a hash table of size size.