Class DivisionMethodHashFunction

java.lang.Object
  |
  +--DivisionMethodHashFunction
All Implemented Interfaces:
IHashFunction

public class DivisionMethodHashFunction
extends Object
implements IHashFunction

IHashFunction implementation using the division method.


Field Summary
protected  int N
          Length of the array for hashtable using this.
 
Constructor Summary
DivisionMethodHashFunction(int aLength)
          Constructs a new hash function with the given array length.
 
Method Summary
 int hash(Object aKey)
          Returns the hash index for the given key object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

N

protected int N
Length of the array for hashtable using this.

Constructor Detail

DivisionMethodHashFunction

public DivisionMethodHashFunction(int aLength)
Constructs a new hash function with the given array length.

Parameters:
aLength - length of the array
Method Detail

hash

public int hash(Object aKey)
Returns the hash index for the given key object.

Specified by:
hash in interface IHashFunction
Parameters:
aKey - key to hash