Package repast.simphony.util
Class HashCodeUtil
- java.lang.Object
-
- repast.simphony.util.HashCodeUtil
-
public class HashCodeUtil extends Object
- Author:
- Howe
-
-
Field Summary
Fields Modifier and Type Field Description static int
SEED
An 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 int
hash(int aSeed, boolean aBoolean)
booleans.static int
hash(int aSeed, char aChar)
chars.static int
hash(int aSeed, double aDouble)
doubles.static int
hash(int aSeed, float aFloat)
floats.static int
hash(int aSeed, int aInt)
ints.static int
hash(int aSeed, long aLong)
longs.static int
hash(int aSeed, Object aObject)
aObject
is 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 ofhashCode
values.- See Also:
- Constant Field Values
-
-
Method Detail
-
hash
public static int hash(int aSeed, boolean aBoolean)
booleans.
-
hash
public static int hash(int aSeed, char aChar)
chars.
-
hash
public static int hash(int aSeed, int aInt)
ints.
-
hash
public static int hash(int aSeed, long aLong)
longs.
-
hash
public static int hash(int aSeed, float aFloat)
floats.
-
hash
public static int hash(int aSeed, double aDouble)
doubles.
-
hash
public static int hash(int aSeed, Object aObject)
aObject
is a possibly-null object field, and possibly an array. IfaObject
is an array, then each element may be a primitive or a possibly-null object.
-
-