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. |
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 |
N
protected int N
- Length of the array for hashtable using this.
DivisionMethodHashFunction
public DivisionMethodHashFunction(int aLength)
- Constructs a new hash function with the given array length.
- Parameters:
aLength
- length of the array
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