|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectHashCodeUtil
public final class HashCodeUtil
Collected methods which allow easy implementation of hashCode. Example use case:
public int hashCode(){
final int result = HashCodeUtil.SEED;
//collect the contributions of various fields
result = HashCodeUtil.hash(result, fPrimitive);
result = HashCodeUtil.hash(result, fObject);
result = HashCodeUtil.hash(result, fArray);
return result;
}
| Field Summary | |
|---|---|
static int |
SEED
An initial value for a hashCode, to which is added contributions from fields. |
| Constructor Summary | |
|---|---|
HashCodeUtil()
|
|
| Method Summary | |
|---|---|
static int |
hash(int aSeed,
boolean aBoolean)
booleans. |
static int |
hash(int aSeed,
boolean[] aArray)
Arrays of booleans. |
static int |
hash(int aSeed,
byte[] aArray)
Arrays of bytes. |
static int |
hash(int aSeed,
char aChar)
chars. |
static int |
hash(int aSeed,
char[] aArray)
Arrays of chars. |
static int |
hash(int aSeed,
double aDouble)
doubles. |
static int |
hash(int aSeed,
double[] aArray)
Arrays of doubles. |
static int |
hash(int aSeed,
float aFloat)
floats. |
static int |
hash(int aSeed,
float[] aArray)
Arrays of floats. |
static int |
hash(int aSeed,
int aInt)
ints. |
static int |
hash(int aSeed,
int[] aArray)
Arrays of integers. |
static int |
hash(int aSeed,
long aLong)
longs. |
static int |
hash(int aSeed,
long[] aArray)
Arrays of longs |
static int |
hash(int aSeed,
Object aObject)
Possibly-null Object fields. |
static int |
hash(int aSeed,
Object[] aArray)
Arrays of Objects. |
static int |
hash(int aSeed,
short[] aArray)
Arrays of shorts. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SEED
| Constructor Detail |
|---|
public HashCodeUtil()
| Method Detail |
|---|
public static int hash(int aSeed,
boolean aBoolean)
public static int hash(int aSeed,
char aChar)
public static int hash(int aSeed,
int aInt)
public static int hash(int aSeed,
long aLong)
public static int hash(int aSeed,
float aFloat)
public static int hash(int aSeed,
double aDouble)
public static int hash(int aSeed,
Object aObject)
public static int hash(int aSeed,
Object[] aArray)
public static int hash(int aSeed,
boolean[] aArray)
public static int hash(int aSeed,
char[] aArray)
public static int hash(int aSeed,
byte[] aArray)
public static int hash(int aSeed,
short[] aArray)
public static int hash(int aSeed,
int[] aArray)
public static int hash(int aSeed,
long[] aArray)
public static int hash(int aSeed,
float[] aArray)
public static int hash(int aSeed,
double[] aArray)
|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||