Java Utililty Methods Array Deep Hash Code

List of utility methods to do Array Deep Hash Code

  1. HOME
  2. Java
  3. A
  4. Array Deep Hash Code

Description

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

Method

int deepHashCode(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;
int deepHashCode(final Iterable stream)
deep Hash Code
int hash = 0;
for (final T next : stream)
 hash = 31 * hash + (next == null ? 0 : next.hashCode());
return hash;
int deepHashCode(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[])
...
int deepHashCode(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);
...

AltStyle によって変換されたページ (->オリジナル) /