|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjdsl.core.ref.ObjectHashComparator
Implements the JDSL HashComparator interface in terms of Java's native Object methods equals(.) and hashCode().
Constructor Summary | |
ObjectHashComparator()
|
Method Summary | |
int |
hashValue(Object o)
Returns the hash code value to be used for the object in this comparator. |
boolean |
isComparable(Object o)
Allows a container (or any client) to find out whether an object is a member of the ordered set over which this comparator is defined. |
boolean |
isEqualTo(Object x1,
Object x2)
returns x1.equals(x2) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectHashComparator()
Method Detail |
public boolean isComparable(Object o)
EqualityComparator
isComparable
in interface EqualityComparator
o
- Object you propose to compare with this comparator
public boolean isEqualTo(Object x1, Object x2) throws ClassCastException
isEqualTo
in interface EqualityComparator
x1
- the reference object in the comparison.x2
- the object tested against the reference object.
ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.public int hashValue(Object o)
HashComparator
It is expected that hashValue will return a non-negative integer as the hashcode of the Object, as is the custom for hashcodes. However, there are no unsigned types to force this.
hashValue
in interface HashComparator
o
- Object for which you desire a hash value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |