Java Utililty Methods Array Deep Hash Code

List of utility methods to do Array Deep Hash Code

Description

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

Method

intdeepHashCode(byte[] array)
Computes a hashcode based on the contents of a one-dimensional byte array rather than its identity.
int result = 1;
for (int i = 0; i < array.length; i++) {
    result = 31 * result + array[i];
return result;
intdeepHashCode(final Iterable stream)
deep Hash Code
int hash = 0;
for (final T next : stream)
    hash = 31 * hash + (next == null ? 0 : next.hashCode());
return hash;
intdeepHashCode(Object a[])
Returns a hash code based on the "deep contents" of the specified array.
if (a == null)
    return 0;
int result = 1;
for (Object element : a) {
    int elementHash = 0;
    if (element instanceof Object[])
        elementHash = deepHashCode((Object[]) element);
    else if (element instanceof byte[])
...
intdeepHashCode(Object a[])
Copied from Arrays.deepHashCode.
if (a == null) {
    return 0;
int result = 1;
for (Object element : a) {
    int elementHash = 0;
    if (element instanceof Object[]) {
        elementHash = deepHashCode((Object[]) element);
...