Java Hash Code Calculate hashcode(Object... as)

Here you can find the source of hashcode(Object... as)

Description

Compute the hash code for the given items

License

Apache License

Declaration

public static int hashcode(Object... as) 

Method Source Code

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

public class Main {
    /**/*from w  ww.jav a  2 s .  c  om*/
     * Compute the hash code for the given items
     */
    public static int hashcode(Object... as) {
        if (as == null)
            return 0;
        int h = 1;
        int i = 0;
        while (i < as.length) {
            if (as[i] != null) {
                h = 31 * h + as[i].hashCode();
                i += 1;
            }
        }
        return h;
    }
}

Related

  1. hashCode(Object objects[])
  2. hashCode(Object value)
  3. hashCode(Object value)
  4. hashCode(Object value)
  5. hashCode(Object value)
  6. hashCode(Object... fields)
  7. hashCode(Object... objects)
  8. hashCode(Object... objects)
  9. hashCode(Object... objs)