|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweblogic.wsee.util.HashCodeUtil
public final class HashCodeUtil
Collected methods which allow easy implementation of hashCode
.
Example use case:
public int hashCode() { 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
Deprecated. An initial value for a hashCode , to which is added
contributions from fields. |
Constructor Summary | |
---|---|
HashCodeUtil()
Deprecated. |
Method Summary | |
---|---|
static int |
hash(int aSeed,
boolean aBoolean)
Deprecated. booleans. |
static int |
hash(int aSeed,
char aChar)
Deprecated. chars. |
static int |
hash(int aSeed,
Collection aCollection)
Deprecated. aCollection is a possibly-null Collection field |
static int |
hash(int aSeed,
double aDouble)
Deprecated. doubles. |
static int |
hash(int aSeed,
float aFloat)
Deprecated. floats. |
static int |
hash(int aSeed,
int aInt)
Deprecated. ints. |
static int |
hash(int aSeed,
long aLong)
Deprecated. longs. |
static int |
hash(int aSeed,
Object aObject)
Deprecated. aObject is a possibly-null object field, and possibly an
array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SEED
hashCode
, to which is added
contributions from fields. Using a non-zero value decreases collisons of
hashCode
values.
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)
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(int aSeed, Collection aCollection)
aCollection
is a possibly-null Collection field
|
Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |