org.jjoost.util
Interface Equality<E>

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
Equalities.ByteArrayEquality, Equalities.CaseInsensitiveEquality, Equalities.EntryEquality, Equalities.IdentityEquality, Equalities.IntArrayEquality, Equalities.LongArrayEquality, Equalities.ObjectArrayEquality, Equalities.ObjectEquality, Equalities.RehashingEquality

public interface Equality<E>
extends java.io.Serializable

This interface declares a method which defines equality been objects of type E

Author:
b.elliottsmith

Method Summary
 boolean equates(E a, E b)
          Returns a boolean indicating if the two parameters are considered equal by this Equality
 int hash(E o)
          Returns the hash value of the object as defined by this Equality.
 

Method Detail

equates

boolean equates(E a,
                E b)
Returns a boolean indicating if the two parameters are considered equal by this Equality

Parameters:
a - an Object of type E
b - another Object of type E
Returns:
true if this equality equates the two arguments

hash

int hash(E o)
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)

Parameters:
o - an Object of type E
Returns:
the hash of the parameter