Algorithm
Development Kit 1.0

algs.model.search
Class SimpleHash

java.lang.Object
  extended by algs.model.search.SimpleHash
All Implemented Interfaces:
IHash<java.lang.String>

public class SimpleHash
extends java.lang.Object
implements IHash<java.lang.String>

Implements standard java.lang.String hash computation on String objects.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman, Gary Pollice

Constructor Summary
SimpleHash(int tableSize)
          hash needs to know size of the table.
 
Method Summary
 int hash(java.lang.String s)
          Compute the proper index into a hashtable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHash

public SimpleHash(int tableSize)
hash needs to know size of the table.

Method Detail

hash

public int hash(java.lang.String s)
Description copied from interface: IHash
Compute the proper index into a hashtable.

Specified by:
hash in interface IHash<java.lang.String>

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.