Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_HASH_CODE
Initial hash code value as suggested by Joshua Bloch, Effective Java
second edition.
|
static int |
ODD_PRIME_HASH_CODE
Value to multiply each individual hash code by, as suggested by Joshua
Bloch, Effective Java second edition.
|
Modifier and Type | Method and Description |
---|---|
static int |
computeHashCode(int currentHashCode,
boolean value)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it. |
static int |
computeHashCode(int currentHashCode,
double value)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it. |
static int |
computeHashCode(int currentHashCode,
float value)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it. |
static int |
computeHashCode(int currentHashCode,
int value)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it. |
static int |
computeHashCode(int currentHashCode,
long value)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it. |
static int |
computeHashCode(int currentHashCode,
Object object)
Multiplies the supplied currentHashCode by
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied object, to it. |
public static final int INITIAL_HASH_CODE
public static final int ODD_PRIME_HASH_CODE
public static int computeHashCode(int currentHashCode, boolean value)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it.currentHashCode
- The currently computed hash code.value
- The value to compute the hash code for.public static int computeHashCode(int currentHashCode, int value)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it.currentHashCode
- The currently computed hash code.value
- The value to compute the hash code for.public static int computeHashCode(int currentHashCode, long value)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it.currentHashCode
- The currently computed hash code.value
- The value to compute the hash code for.public static int computeHashCode(int currentHashCode, float value)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it.currentHashCode
- The currently computed hash code.value
- The value to compute the hash code for.public static int computeHashCode(int currentHashCode, double value)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied value, to it.currentHashCode
- The currently computed hash code.value
- The value to compute the hash code for.public static int computeHashCode(int currentHashCode, Object object)
ODD_PRIME_HASH_CODE
and adds the hash code, computed for the supplied object, to it.currentHashCode
- The currently computed hash code.object
- The object to compute the hash code for.Copyright © 2008–2018. All rights reserved.