Here you can find the source of hashArray(int h, Object[] a)
public static int hashArray(int h, Object[] a)
//package com.java2s; /*/*from w w w .j ava 2 s . c o m*/ // This software is subject to the terms of the Eclipse Public License v1.0 // Agreement, available at the following URL: // http://www.eclipse.org/legal/epl-v10.html. // You must accept the terms of that agreement to use this software. // // Copyright (C) 2001-2005 Julian Hyde // Copyright (C) 2005-2012 Pentaho and others // All Rights Reserved. */ public class Main { /** * Computes a hash code from an existing hash code and an array of objects * (which may be null). */ public static int hashArray(int h, Object[] a) { // The hashcode for a null array and an empty array should be different // than h, so use magic numbers. if (a == null) { return hash(h, 19690429); } if (a.length == 0) { return hash(h, 19690721); } for (Object anA : a) { h = hash(h, anA); } return h; } /** * Combines two integers into a hash code. */ public static int hash(int i, int j) { return (i << 4) ^ j; } /** * Computes a hash code from an existing hash code and an object (which * may be null). */ public static int hash(int h, Object o) { int k = (o == null) ? 0 : o.hashCode(); return ((h << 4) | h) ^ k; } }