|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.text.base.AbstractStringHasher
public abstract class AbstractStringHasher
This is the abstract base implementation of the StringHasher
interface.
NOTE:
For efficiency you should override some of the default
method-implementations.
| Constructor Summary | |
|---|---|
AbstractStringHasher()
The constructor. |
|
| Method Summary | |
|---|---|
int |
getHashCode(CharSequence string)
This method gets the hash-code for the given string. |
int |
getHashCode(CharSequence string,
int start,
int end)
This method gets the hash-code for the specified subsequence of the given
string. |
int[] |
getHashCodes(char[] string,
int length)
This method gets the hash-codes for all subsequence of
string that have the given length. |
int[] |
getHashCodes(char[] string,
int length,
int stringStart,
int stringEnd)
This method gets the hash-codes for all subsequence of
string from stringStart (inclusive) until
stringEnd (exclusive) that have the given length. |
int[] |
getHashCodes(CharSequence string,
int length)
This method gets the hash-codes for all subsequence of
string that have the given length. |
int[] |
getHashCodes(CharSequence string,
int length,
int stringStart,
int stringEnd)
This method gets the hash-codes for all subsequence of
string from stringStart (inclusive) until
stringEnd (exclusive) that have the given length. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.text.api.StringHasher |
|---|
getHashCode |
| Constructor Detail |
|---|
public AbstractStringHasher()
| Method Detail |
|---|
public int getHashCode(CharSequence string)
string.
getHashCode in interface StringHasherstring - is the CharSequence to hash.
StringHasher.getHashCode(CharSequence, int, int)
public int getHashCode(CharSequence string,
int start,
int end)
subsequence of the given
string.
getHashCode in interface StringHasherstring - is the CharSequence containing the
subsequence 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.
Object.hashCode()
public int[] getHashCodes(CharSequence string,
int length)
subsequence of
string that have the given length.
getHashCodes in interface StringHasherstring - is the string as char-array.length - is the length of the
sub-sequences of
string to hash.
string is less than the given length.StringHasher.getHashCodes(char[], int)
public int[] getHashCodes(char[] string,
int length)
subsequence of
string that have the given length.
getHashCodes in interface StringHasherstring - is the string as char-array.length - is the length of the
sub-sequences of
string to hash.
string is less than the given length.StringHasher.getHashCodes(char[], int, int, int)
public int[] getHashCodes(CharSequence string,
int length,
int stringStart,
int stringEnd)
subsequence of
string from stringStart (inclusive) until
stringEnd (exclusive) that have the given length.
getHashCodes in interface StringHasherstring - is the string as char-array.length - is the length of the
sub-sequences of
string to hash.stringStart - is the index where to start in string.stringEnd - is the index where to stop in string.
string is less than the given length.StringHasher.getHashCodes(char[], int)
public int[] getHashCodes(char[] string,
int length,
int stringStart,
int stringEnd)
subsequence of
string from stringStart (inclusive) until
stringEnd (exclusive) that have the given length.
int size = stringEnd - stringStart - length + 1;
if (size <= 0) {
return new int[0];
}
int[] result = new int[size];
for (int i = 0; i < size; i++) {
result[i] = getHashCode(string, i, i + length);
}
return result;
getHashCodes in interface StringHasherstring - is the string as char-array.length - is the length of the
sub-sequences of
string to hash.stringStart - is the index where to start in string.stringEnd - is the index where to stop in string.
string is less than the given length.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||