Java Hash Calculate hash(Object[] state)

Here you can find the source of hash(Object[] state)

Description

hash

License

Open Source License

Declaration

public static int hash(Object[] state) 

Method Source Code

//package com.java2s;
/*//from w w w .j  av  a2 s .  co m
 * $Id$
 * --------------------------------------------------------------------------------------
 * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 *
 * The software in this package is published under the terms of the CPAL v1.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE.txt file.
 */

public class Main {
    public static int hash(Object[] state) {
        int hash = 0;
        for (int i = 0; i < state.length; ++i) {
            hash = hash * 31 + (null == state[i] ? 0 : state[i].hashCode());
        }
        return hash;
    }
}

Related

  1. hash(Object... as)
  2. hash(Object... value)
  3. hash(Object... values)
  4. hash(Object[] array)
  5. hash(Object[] array)
  6. hash1(int val)
  7. hash1(Object a)
  8. hash16(int hash)
  9. hash3(int hash, Object x, Object y, Object z)