Java Hash Calculate hashIt(Object o)

Here you can find the source of hashIt(Object o)

Description

Return an object's hash code or 0 if the object is null.

License

Open Source License

Declaration

public static int hashIt(Object o) 

Method Source Code

//package com.java2s;
/* /*from  w  w  w .j  a  v  a2s.c om*/
 * This file is part of the HyperGraphDB source distribution. This is copyrighted 
 * software. For permitted uses, licensing options and redistribution, please see  
 * the LicensingInformation file at the root level of the distribution.  
 * 
 * Copyright (c) 2005-2010 Kobrix Software, Inc.  All rights reserved. 
 */

public class Main {
    /**
     * <p>Return an object's hash code or 0 if the object is <code>null</code>.</p>
     */
    public static int hashIt(Object o) {
        if (o == null)
            return 0;
        else
            return o.hashCode();
    }
}

Related

  1. hashForEqual(Class clazz)
  2. hashHC(int i)
  3. hashHsieh(int init, Object... vals)
  4. hashInt(final int v)
  5. hashIntArray(int seed, int[] data, int offset, int len)
  6. hashJava32(byte[] byteList)
  7. hashJava64(byte[] byteList)
  8. hashJenkins(int init, Object... vals)
  9. hashLong(long id)