Java Utililty Methods Hash Code Calculate

List of utility methods to do Hash Code Calculate

Description

The list of methods to do Hash Code Calculate are organized into topic(s).

Method

inthashCode(final Object... array)
hash Code
if (array == null) {
    return 0;
int result = 1;
Object element;
for (final Object element2 : array) {
    element = element2;
    result = 31 * result + ((element == null) ? 0 : element.hashCode());
...
inthashCode(float value)
hash Code
return Float.floatToIntBits(value);
inthashCode(int base, int multiplier, boolean fastArrays, Object... relevantValues)
hash Code
int hashCode = base * multiplier + relevantValues.length;
for (Object value : relevantValues) {
    if (value == null || value.getClass() == Object.class)
        continue;
    if (fastArrays && value instanceof Object[]) {
        Object[] array = (Object[]) value;
        hashCode = hashCode * multiplier + array.length;
        for (int i = 0; i < array.length; i <<= 1) {
...
inthashCode(int currentHashCodeValue, boolean b)
hash Code
return PRIME * currentHashCodeValue + (b ? 1 : 0);
inthashCode(int mul, Object obj)
hash Code
if (null != obj) {
    return obj.hashCode() * mul;
return 0;
inthashCode(int num)
Hash the specified int using implementation proposed in Josh Bloch's "Effective Java".
return 37 * HASH_CODE + num;
inthashCode(int previous, boolean x)
hash Code
return (PRIME * previous) + (x ? 1 : 0);
inthashCode(int result, Object obj)
hash Code
result = 37 * result + (obj == null ? 0 : obj.hashCode());
return result;
inthashCode(int val)
hash Code
return val;
inthashCode(int[] a)
hash Code
if (a == null)
    return 0;
int result = 1;
for (int element : a)
    result = (31 * result + element) ^ result;
return result;