de.uniba.wiai.lspi.chord.service.impl
Class HashFunction

java.lang.Object
  extended by de.uniba.wiai.lspi.chord.service.impl.HashFunction

public final class HashFunction
extends java.lang.Object

Provides a hash function for calculating the hash value out of Key or URL objects.

Version:
1.0.5
Author:
Karsten Loesing, Sven Kaffille

Method Summary
static HashFunction getHashFunction()
          Returns the singleton instance of this class.
 ID getHashKey(Key entry)
          Calculates the hash value for a given data Key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHashFunction

public static HashFunction getHashFunction()
Returns the singleton instance of this class.

Returns:
Singleton instance of HashFunction.
Throws:
java.lang.RuntimeException - If there is an internal problem with the specified hash function of the Java API.

getHashKey

public final ID getHashKey(Key entry)
Calculates the hash value for a given data Key.

Parameters:
entry -
Returns:
ID for the given Key.