org.jjoost.util
Class Equalities.ByteArrayEquality

java.lang.Object
  extended by org.jjoost.util.Equalities.ByteArrayEquality
All Implemented Interfaces:
java.io.Serializable, Equality<byte[]>
Enclosing class:
Equalities

public static class Equalities.ByteArrayEquality
extends java.lang.Object
implements Equality<byte[]>

an Equality over objects of type byte[], delegating to java.util.Arrays.equals(a, b) and java.util.Arrays.hashCode(k)

Author:
b.elliottsmith
See Also:
Serialized Form

Constructor Summary
Equalities.ByteArrayEquality()
           
 
Method Summary
 boolean equates(byte[] a, byte[] b)
          Returns a boolean indicating if the two parameters are considered equal by this Equality
 int hash(byte[] 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
 

Constructor Detail

Equalities.ByteArrayEquality

public Equalities.ByteArrayEquality()
Method Detail

equates

public final boolean equates(byte[] a,
                             byte[] 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<byte[]>
Parameters:
a - an Object of type E
b - another Object of type E
Returns:
true if this equality equates the two arguments

hash

public final int hash(byte[] 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<byte[]>
Parameters:
k - an Object of type E
Returns:
the hash of the parameter