Package org.h2.dev.hash
Class MinimalPerfectHash.LongHash
- java.lang.Object
-
- org.h2.dev.hash.MinimalPerfectHash.LongHash
-
- All Implemented Interfaces:
MinimalPerfectHash.UniversalHash<java.lang.Long>
- Enclosing class:
- MinimalPerfectHash<K>
public static class MinimalPerfectHash.LongHash extends java.lang.Object implements MinimalPerfectHash.UniversalHash<java.lang.Long>
A sample hash implementation for long keys.
-
-
Constructor Summary
Constructors Constructor Description LongHash()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inthashCode(java.lang.Long o, int index, int seed)Calculate the hash of the given object.
-
-
-
Method Detail
-
hashCode
public int hashCode(java.lang.Long o, int index, int seed)Description copied from interface:MinimalPerfectHash.UniversalHashCalculate the hash of the given object.- Specified by:
hashCodein interfaceMinimalPerfectHash.UniversalHash<java.lang.Long>- Parameters:
o- the objectindex- the hash function index (index 0 is used first, so the method should be very fast with index 0; index 1 and so on are only called when really needed)seed- the random seed (always the same for a hash table)- Returns:
- the hash value
-
-