Package org.hpccsystems.ws.client.utils
Class HashCodeUtil
- java.lang.Object
-
- org.hpccsystems.ws.client.utils.HashCodeUtil
-
public final class HashCodeUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intSEEDAn initial value for ahashCode, to which is added contributions from fields.
-
Constructor Summary
Constructors Constructor Description HashCodeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static inthash(int aSeed, boolean aBoolean)booleans.static inthash(int aSeed, char aChar)chars.static inthash(int aSeed, double aDouble)doubles.static inthash(int aSeed, float aFloat)floats.static inthash(int aSeed, int aInt)ints.static inthash(int aSeed, long aLong)longs.static inthash(int aSeed, Object aObject)aObjectis a possibly-null object field, and possibly an array.
-
-
-
Field Detail
-
SEED
public static final int SEED
An initial value for ahashCode, to which is added contributions from fields. Using a non-zero value decreases collisons ofhashCodevalues.- See Also:
- Constant Field Values
-
-
Method Detail
-
hash
public static int hash(int aSeed, boolean aBoolean)booleans.- Parameters:
aSeed- the a seedaBoolean- the a boolean- Returns:
- the int
-
hash
public static int hash(int aSeed, char aChar)chars.- Parameters:
aSeed- the a seedaChar- the a char- Returns:
- the int
-
hash
public static int hash(int aSeed, int aInt)ints.- Parameters:
aSeed- the a seedaInt- the a int- Returns:
- the int
-
hash
public static int hash(int aSeed, long aLong)longs.- Parameters:
aSeed- the a seedaLong- the a long- Returns:
- the int
-
hash
public static int hash(int aSeed, float aFloat)floats.- Parameters:
aSeed- the a seedaFloat- the a float- Returns:
- the int
-
hash
public static int hash(int aSeed, double aDouble)doubles.- Parameters:
aSeed- the a seedaDouble- the a double- Returns:
- the int
-
hash
public static int hash(int aSeed, Object aObject)aObjectis a possibly-null object field, and possibly an array. IfaObjectis an array, then each element may be a primitive or a possibly-null object.- Parameters:
aSeed- the a seedaObject- the a object- Returns:
- the int
-
-