|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jdc.lang.Object
|
+--com.jdc.lang.HashCode
HashCode is a convenience class used to generate a hash code based
on the principles in Effective Java Programming Language Guide by Joshua
Bloch. Refer to the algorithm discussed in Item 8 on pages 36 thru 41.
| Field Summary |
| Fields inherited from class com.jdc.lang.Object |
string |
| Constructor Summary | |
HashCode()
Constructs a new HashCode object. |
|
| Method Summary | |
HashCode |
compute(boolean value)
Computes an int hash code for this boolean value. |
HashCode |
compute(byte value)
Computes an int hash code for this byte value. |
HashCode |
compute(char value)
Computes an int hash code for this char value. |
HashCode |
compute(double value)
Computes an int hash code for this double value. |
HashCode |
compute(float value)
Computes an int hash code for this float value. |
HashCode |
compute(int value)
Computes an int hash code for this int value. |
HashCode |
compute(long value)
Computes an int hash code for this long value. |
HashCode |
compute(Object object)
Computes an int hash code for this Object. |
HashCode |
compute(short value)
Computes an int hash code for this short value. |
HashCode |
compute(String value)
Computes an int hash code for this String value. |
int |
result()
Returns the int hash code result. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HashCode()
HashCode object.
| Method Detail |
public HashCode compute(boolean value)
int hash code for this boolean value.
The value is computed as described on Page 38, Step 2.a.i: Compute an
int for the field.
HashCode object.public HashCode compute(byte value)
int hash code for this byte value.
The value is computed as described on Page 38, Step 2.a.ii: Compute an
int for the field.
HashCode object.public HashCode compute(char value)
int hash code for this char value.
The value is computed as described on Page 38, Step 2.a.ii: Compute an
int for the field.
HashCode object.public HashCode compute(double value)
int hash code for this double value.
The value is computed as described on Page 38, Step 2.a.v: Compute an
int for the field.
HashCode object.public HashCode compute(float value)
int hash code for this float value.
The value is computed as described on Page 38, Step 2.a.iv: Compute an
int for the field.
HashCode object.public HashCode compute(int value)
int hash code for this int value.
The value is computed as described on Page 38, Step 2.a.ii: Compute an
int for the field.
HashCode object.public HashCode compute(long value)
int hash code for this long value.
The value is computed as described on Page 38, Step 2.a.iii: Compute an
int for the field.
HashCode object.public HashCode compute(short value)
int hash code for this short value.
The value is computed as described on Page 38, Step 2.a.ii: Compute an
int for the field.
HashCode object.public HashCode compute(Object object)
int hash code for this Object.
HashCode object.public HashCode compute(String value)
int hash code for this String value.
HashCode object.public int result()
int hash code result. The result is computed as
described on Page 39, Step 3: Return the result.
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||