Java Hash Calculate hashThem(Object one, Object two)

Here you can find the source of hashThem(Object one, Object two)

Description

Return a composite hash code of two objects.

License

Open Source License

Declaration

public static int hashThem(Object one, Object two) 

Method Source Code

//package com.java2s;
/* /*from   w  ww. j av  a2  s . co m*/
 * 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 a composite hash code of two objects.</p>
     */
    public static int hashThem(Object one, Object two) {
        return hashIt(one) | hashIt(two);
    }

    /**
     * <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. hashOrZero(Object o)
  2. hashPair(int a, int b)
  3. hashpair(Object o1, Object o2)
  4. hashPoint(int hashlength, double fraction)
  5. hashSetSize(final int nrOfElements)
  6. hashToFloat(int x, int y, long seed)
  7. hashToLong(final byte[] hash)
  8. hashToName(long l)
  9. hashV(Object... a)