List of utility methods to do Hash Code Calculate
int | hashcode(Object... as) Compute the hash code for the given items if (as == null) return 0; int h = 1; int i = 0; while (i < as.length) { if (as[i] != null) { h = 31 * h + as[i].hashCode(); i += 1; ... |
int | hashCode(Object... fields) hash Code if (fields == null) throw new IllegalArgumentException("Fields cannot be null"); int hashcode = 0; for (int i = 0; i < fields.length; i++) { Object currentField = fields[i]; hashcode += currentField != null ? currentField.hashCode() : 0; return hashcode; ... |
int | hashCode(Object... objects) Hash code from a bunch of objects int result = 31 + hashCode(objects[0]); for (int i = 1; i < objects.length; i++) { result *= 31 + hashCode(objects[i]); return result; |
int | hashCode(Object... objects) Computes the hash code of a set of objects. int result = 17; if (objects != null) { for (final Object obj : objects) { result = 31 * result + (obj == null ? 0 : obj.hashCode()); return result; |
int | hashCode(Object... objs) hash Code int code = 0; for (Object o : objs) { code ^= System.identityHashCode(o); return code; |
int | hashCode(Object... toHash) shortcut for hashing some stuff. int hash = 7; for (Object o : toHash) { if (o != null) { hash = 31 * hash + o.hashCode(); return hash; |
int | hashCode(Object[] array) hash Code int prime = 31; if (array == null) { return 0; int result = 1; for (int index = 0; index < array.length; index++) { result = prime * result + (array[index] == null ? 0 : array[index].hashCode()); return result; |
int | hashCode(Object[] thisFields) Helper function to compute hasCode by fields. final int prime = 31; int result = 1; for (int i = 0; i < thisFields.length; i++) { Object field = thisFields[i]; if (field != null) { result = prime * result + field.hashCode(); return result; |
int | hashcode_old(final int[] array) Computes a hashcode for an integer array. int result = 23; for (int i = 0; i < array.length; i++) { result = (37 * result) + array[i]; return result; |
int | hashCodeEps(double value) hash Code Eps return Long.valueOf(Math.round(value / EPSILON)).hashCode();
|