org.infinispan.util.hash
Interface Hash

All Known Implementing Classes:
MurmurHash2, MurmurHash2Compat

public interface Hash

Interface that governs implementations

Author:
Manik Surtani, Patrick McFarland
See Also:
MurmurHash2

Method Summary
 int hash(byte[] payload)
          Hashes a byte array efficiently.
 int hash(int hashcode)
          An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived from Object.hashCode().
 int hash(Object o)
          A helper that calculates the hashcode of an object, choosing the optimal mechanism of hash calculation after considering the type of the object (byte array, String or Object).
 

Method Detail

hash

int hash(byte[] payload)
Hashes a byte array efficiently.

Parameters:
payload - a byte array to hash
Returns:
a hash code for the byte array

hash

int hash(int hashcode)
An incremental version of the hash function, that spreads a pre-calculated hash code, such as one derived from Object.hashCode().

Parameters:
hashcode - an object's hashcode
Returns:
a spread and hashed version of the hashcode

hash

int hash(Object o)
A helper that calculates the hashcode of an object, choosing the optimal mechanism of hash calculation after considering the type of the object (byte array, String or Object).

Parameters:
o - object to hash
Returns:
a hashcode


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.