net.sf.mmm.util.text.base
Class SimpleStringHasher

java.lang.Object
  extended by net.sf.mmm.util.text.base.AbstractStringHasher
      extended by net.sf.mmm.util.text.base.SimpleStringHasher
All Implemented Interfaces:
StringHasher

public class SimpleStringHasher
extends AbstractStringHasher

This is a simple, inefficient implementation of StringHasher that is compatible to String.hashCode().

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Constructor Summary
SimpleStringHasher()
          The constructor.
 
Method Summary
 int getHashCode(char[] string, int start, int end)
          This method gets the hash-code for the specified subsequence of the given string.
 
Methods inherited from class net.sf.mmm.util.text.base.AbstractStringHasher
getHashCode, getHashCode, getHashCodes, getHashCodes, getHashCodes, getHashCodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleStringHasher

public SimpleStringHasher()
The constructor.

Method Detail

getHashCode

public int getHashCode(char[] string,
                       int start,
                       int end)
This method gets the hash-code for the specified subsequence of the given string.

Parameters:
string - is the char-array containing the substring to hash.
start - is the index of the first character to include into the hash.
end - is the index one before the last character to include into the hash.
Returns:
the according hash-code.
See Also:
Object.hashCode()


Copyright © 2001-2010 mmm-Team. All Rights Reserved.