org.jjoost.util
Class Equalities.IdentityEquality
java.lang.Object
org.jjoost.util.Equalities.IdentityEquality
- All Implemented Interfaces:
- java.io.Serializable, Equality<java.lang.Object>
- Enclosing class:
- Equalities
public static class Equalities.IdentityEquality
- extends java.lang.Object
- implements Equality<java.lang.Object>
an Equality for identity equality, i.e. like IdentityHashMap. Delegates to language equality (
a == b) and System.identityHashCode()
- Author:
- b.elliottsmith
- See Also:
- Serialized Form
|
Method Summary |
boolean |
equates(java.lang.Object a,
java.lang.Object b)
Returns a boolean indicating if the two parameters are considered equal by this Equality |
int |
hash(java.lang.Object k)
Returns the hash value of the object as defined by this Equality. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Equalities.IdentityEquality
public Equalities.IdentityEquality()
equates
public final boolean equates(java.lang.Object a,
java.lang.Object b)
- Description copied from interface:
Equality
- Returns a
boolean indicating if the two parameters are considered equal by this Equality
- Specified by:
equates in interface Equality<java.lang.Object>
- Parameters:
a - an Object of type Eb - another Object of type E
- Returns:
true if this equality equates the two arguments
hash
public final int hash(java.lang.Object k)
- Description copied from interface:
Equality
- Returns the hash value of the object as defined by this
Equality. For all objects this Equality can be
applied to, it should be the case that equates(a, b) ==> hash(a) == hash(b)
- Specified by:
hash in interface Equality<java.lang.Object>
- Parameters:
k - an Object of type E
- Returns:
- the hash of the parameter