com.wizzardo.tools.io
Class BoyerMoore
java.lang.Object
com.wizzardo.tools.io.BoyerMoore
public class BoyerMoore
- extends java.lang.Object
|
Field Summary |
protected static int |
ALPHABET_SIZE
|
protected static java.nio.charset.Charset |
UTF8
|
|
Method Summary |
int |
search(byte[] haystack)
Returns the index within this string of the first occurrence of the
specified substring. |
int |
search(byte[] haystack,
int offset,
int length)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UTF8
protected static final java.nio.charset.Charset UTF8
ALPHABET_SIZE
protected static final int ALPHABET_SIZE
- See Also:
- Constant Field Values
BoyerMoore
public BoyerMoore(java.lang.String s)
BoyerMoore
public BoyerMoore(byte[] needle)
BoyerMoore
public BoyerMoore(byte[] needle,
int offset,
int length)
search
public int search(byte[] haystack)
- Returns the index within this string of the first occurrence of the
specified substring. If it is not a substring, return -1.
- Parameters:
haystack - The string to be scanned
- Returns:
- The start index of the substring
search
public int search(byte[] haystack,
int offset,
int length)