Package repast.simphony.util
Class HashCodeUtil
java.lang.Object
repast.simphony.util.HashCodeUtil
- Author:
- Howe
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAn initial value for ahashCode, to which is added contributions from fields. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 intaObjectis a possibly-null object field, and possibly an array.
-
Field Details
-
SEED
public static final int SEEDAn initial value for ahashCode, to which is added contributions from fields. Using a non-zero value decreases collisons ofhashCodevalues.- See Also:
-
-
Constructor Details
-
HashCodeUtil
public HashCodeUtil()
-
-
Method Details
-
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
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.
-