Java Hash Calculate hash(Object... values)

Here you can find the source of hash(Object... values)

Description

hash

License

Apache License

Declaration

public static int hash(Object... values) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int hash(Object... values) {
        int code = 17;
        for (Object value : values) {
            code += hashOrNull(value);/* ww w . j av a2  s .  c om*/
            code *= 37;
        }
        return code;
    }

    public static int hashOrNull(Object value) {
        return value == null ? 1 : value.hashCode();
    }
}

Related

  1. hash(Object v)
  2. hash(Object value)
  3. hash(Object value, int seed)
  4. hash(Object... as)
  5. hash(Object... value)
  6. hash(Object[] array)
  7. hash(Object[] array)
  8. hash(Object[] state)
  9. hash1(int val)