List of utility methods to do Array Hash Code
int | hashCode(final Object[] array1) hash Code if (array1 == null) { return 0; return Arrays.hashCode(array1); |
int | hashCode(Map Implements hashCode for map of string arrays The map of string arrays does't work with hashCode. int hash = 0; for (Map.Entry<String, String[]> entry : a.entrySet()) hash += Arrays.hashCode(entry.getValue()); return hash; |
int | hashCode(Object array) Hashes an array. int hashCode; if (array == null) { hashCode = 0; } else if (array instanceof byte[]) { hashCode = Arrays.hashCode((byte[]) array); } else if (array instanceof short[]) { hashCode = Arrays.hashCode((short[]) array); } else if (array instanceof int[]) { ... |
int | hashCode(Object array) Computes a hash code for the given array based on its content instead of on its identity. Class<?> arrayType = array.getClass(); if (!arrayType.isArray()) { throw new IllegalArgumentException("specified object is not an array"); Class<?> componentType = arrayType.getComponentType(); if (componentType.isPrimitive()) { if (componentType == boolean.class) { return Arrays.hashCode((boolean[]) array); ... |
int | hashCode(String[] names, Object[] values) Computes a descriptor hashcode from its names and values. int hash = 0; for (int i = 0; i < names.length; i++) { Object v = values[i]; int h; if (v == null) { h = 0; } else if (v instanceof Object[]) { h = Arrays.deepHashCode((Object[]) v); ... |
String | printArray(byte[] array, boolean withHash) print Array if (array == null) return "null"; int limit = 8; StringBuilder sb = new StringBuilder(); sb.append("[B0x"); if (array.length <= limit || IS_ARRAYS_DEBUG) { sb.append(toHexString(array)); if (withHash) { ... |