|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metasyntactic.core.HashCode
Convenience class to return the hashcode of any object (including null), or
primitive. This is useful when you end up having to write code looking like
return object == null ? 0 : object.hashCode();
Method Summary | |
static int |
valueOf(boolean value)
Returns the hashcode for the value passed in |
static int |
valueOf(byte value)
Returns the hashcode for the value passed in |
static int |
valueOf(char value)
Returns the hashcode for the value passed in |
static int |
valueOf(double value)
Returns the hashcode for the value passed in |
static int |
valueOf(float value)
Returns the hashcode for the value passed in |
static int |
valueOf(int value)
Returns the hashcode for the value passed in |
static int |
valueOf(long value)
Equivalent to return (int)(value ^ (value >> 32)) |
static int |
valueOf(java.lang.Object o)
Returns the hashcode for the value passed in |
static int |
valueOf(short value)
Returns the hashcode for the value passed in |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int valueOf(java.lang.Object o)
o
- The object to get the hashcode for
public static int valueOf(boolean value)
value
- true
or false
public static int valueOf(byte value)
value
- The value to get the hash code for
public static int valueOf(char value)
value
- The value to get the hash code for
public static int valueOf(short value)
value
- The value to get the hash code for
public static int valueOf(int value)
value
- The value to get the hash code for
public static int valueOf(long value)
return (int)(value ^ (value >> 32))
value
- The value to get the hash code for
public static int valueOf(float value)
value
- The value to get the hash code for
public static int valueOf(double value)
value
- The value to get the hash code for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |