public final class HashCodeUtilities
extends java.lang.Object
hashCode
.
Example use case:
public int hashCode() { int result = HashCodeUtil.hash(someField); result = HashCodeUtil.hash(result, fPrimitive); result = HashCodeUtil.hash(result, fObject); result = HashCodeUtil.hash(result, fArray); return result; }
Constructor and Description |
---|
HashCodeUtilities() |
Modifier and Type | Method and Description |
---|---|
static int |
hash(boolean value) |
static int |
hash(char value) |
static int |
hash(double value) |
static int |
hash(float value) |
static int |
hash(int value) |
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 seed,
java.lang.Object object)
aObject is a possibly-null object field, and possibly an
array. |
static int |
hash(long value) |
static int |
hash(java.lang.Object value) |
public static int hash(int aSeed, boolean aBoolean)
public static int hash(boolean value)
public static int hash(int aSeed, char aChar)
public static int hash(char value)
public static int hash(int aSeed, int aInt)
public static int hash(int value)
public static int hash(int aSeed, long aLong)
public static int hash(long value)
public static int hash(int aSeed, float aFloat)
public static int hash(float value)
public static int hash(int aSeed, double aDouble)
public static int hash(double value)
public static int hash(int seed, java.lang.Object object)
aObject
is a possibly-null object field, and possibly an
array.
If aObject
is an array, then each element may be a primitive
or a possibly-null object.public static int hash(java.lang.Object value)
TV-Browser 3.4.4, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)