org.apache.lucene.util
Class Hash64

Object
  extended by Hash64

public class Hash64
extends Object

Utility class that calculates good 64-bit hash codes for strings.

Author:
Martin Haye

Field Summary
private static long MAGIC_PRIME
           
 
Constructor Summary
Hash64()
           
 
Method Summary
static long hash(String s)
          Calculate a non-negative 64-bit hash code for a string
static long hash(String s1, String s2)
          Calculate a non-negative 64-bit hash code for two strings
static long hash(String s1, String s2, String s3)
          Calculate a non-negative 64-bit hash code for three strings
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC_PRIME

private static final long MAGIC_PRIME
See Also:
Constant Field Values
Constructor Detail

Hash64

public Hash64()
Method Detail

hash

public static long hash(String s)
Calculate a non-negative 64-bit hash code for a string


hash

public static long hash(String s1,
                        String s2)
Calculate a non-negative 64-bit hash code for two strings


hash

public static long hash(String s1,
                        String s2,
                        String s3)
Calculate a non-negative 64-bit hash code for three strings