3
/** Not for public consumption. Usage by the runtime only.
6
public final class Statics {
7
public static int mix(int hash, int data) {
8
int h = mixLast(hash, data);
9
h = Integer.rotateLeft(h, 13);
10
return h * 5 + 0xe6546b64;
13
public static int mixLast(int hash, int data) {
17
k = Integer.rotateLeft(k, 15);
23
public static int finalizeHash(int hash, int length) {
24
return avalanche(hash ^ length);
27
/** Force all bits of the hash to avalanche. Used for finalizing the hash. */
28
public static int avalanche(int h) {
38
public static int longHash(long lv) {
42
return (int)(lv ^ (lv >>> 32));
45
public static int doubleHash(double dv) {
52
return java.lang.Float.floatToIntBits(fv);
58
lv = Double.doubleToLongBits(dv);
59
return (int)(lv ^ (lv >>> 32));
62
public static int floatHash(float fv) {
69
return (int)(lv^(lv>>>32));
71
return java.lang.Float.floatToIntBits(fv);
74
public static int anyHash(Object x) {
78
if (x instanceof java.lang.Long)
79
return longHash(((java.lang.Long)x).longValue());
81
if (x instanceof java.lang.Double)
82
return doubleHash(((java.lang.Double)x).doubleValue());
84
if (x instanceof java.lang.Float)
85
return floatHash(((java.lang.Float)x).floatValue());