List of utility methods to do Hash Code Calculate
int | hashCode(final int i) Computes the hash code for an integer. return i;
|
int | hashCode(final int seed, final int hashcode) hash Code return seed * HASH_OFFSET + hashcode;
|
int | hashCode(final int x, final int y) Returns an integer hash code for a point. final int hashX = ((Integer) x).hashCode(); final int hashY = ((Integer) y).hashCode(); return 31 * hashX + hashY; |
int | hashcode(final int[] array) Computes a hashcode for an integer array, partially unrolled. final int len = array.length; int result = 23; int i = 0; for (; (i + 3) < len; i += 4) { result = (1874161 * result) + (50653 * array[i]) + (1369 * array[i + 1]) + (37 * array[i + 2]) + array[i + 3]; ... |
int | hashCode(final long l) hash Code return (int) (l ^ (l >>> 32)); |
int | hashCode(final long l) hash Code return (int) (l ^ (l >>> 32)); |
int | hashCode(final long v) Return a hashcode for a long. return (int) (v ^ (v >>> 32)); |
int | hashCode(final Object obj) Calculate hashcode of objects. if (obj == null) { return 0; if (obj.getClass().isArray()) { Object[] array = (Object[]) obj; int result = 17; for (int i = 0; i < array.length; i++) { result = result * 37 + hashCode(array[i]); ... |
int | hashCode(final Object obj) hash Code return (obj == null ? 0 : obj.hashCode());
|
int | hashCode(final Object object) Returns a hash code for an object, or zero if the object is null .
int result = 0; if (object != null) { result = object.hashCode(); return result; |