hmi.util
Class HashCodes

java.lang.Object
  extended by hmi.util.HashCodes

public final class HashCodes
extends Object

Hashcode implementation helper class Hashcode algorithms from:
Effective Java, second edition, Joshua Bloch, Addison-Wesley, 2008

Author:
Herwin TODO: It seems Apache commons.lang.HashCodeBuilder has similar functionality + append to combine fields, switch to that?

Field Summary
private static int INTSIZE
           
 
Constructor Summary
private HashCodes()
           
 
Method Summary
 int hashCode()
           
static int hashCode(boolean b)
          Return hashcode for a boolean
 int hashCode(boolean[] arr)
          Return hashcode for a boolean array
static int hashCode(byte b)
          Return hashcode for a byte
 int hashCode(byte[] arr)
          Return hashcode for a byte array
static int hashCode(char c)
          Return hashcode for a char
 int hashCode(char[] arr)
          Return hashcode for a char array
static int hashCode(double d)
          Return hashcode for a double
 int hashCode(double[] arr)
          Return hashcode for a double array
static int hashCode(float f)
          Return hashcode for a float
 int hashCode(float[] arr)
          Return hashcode for a float array
 int hashCode(int[] arr)
          Return hashcode for an int array
static int hashCode(long l)
          Return hashcode for a long
 int hashCode(long[] arr)
          Return hashcode for a long array
 int hashCode(Object[] arr)
          Return hashcode for an Object array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTSIZE

private static final int INTSIZE
See Also:
Constant Field Values
Constructor Detail

HashCodes

private HashCodes()
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hashCode

public static int hashCode(boolean b)
Return hashcode for a boolean


hashCode

public static int hashCode(char c)
Return hashcode for a char


hashCode

public static int hashCode(byte b)
Return hashcode for a byte


hashCode

public static int hashCode(long l)
Return hashcode for a long


hashCode

public static int hashCode(float f)
Return hashcode for a float


hashCode

public static int hashCode(double d)
Return hashcode for a double


hashCode

public int hashCode(Object[] arr)
Return hashcode for an Object array


hashCode

public int hashCode(int[] arr)
Return hashcode for an int array


hashCode

public int hashCode(float[] arr)
Return hashcode for a float array


hashCode

public int hashCode(char[] arr)
Return hashcode for a char array


hashCode

public int hashCode(byte[] arr)
Return hashcode for a byte array


hashCode

public int hashCode(boolean[] arr)
Return hashcode for a boolean array


hashCode

public int hashCode(double[] arr)
Return hashcode for a double array


hashCode

public int hashCode(long[] arr)
Return hashcode for a long array