|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wizzardo.tools.misc.BoyerMoore
public class BoyerMoore
Constructor Summary | |
---|---|
BoyerMoore(byte[] pattern)
Creates a precomputed Boyer-Moore byte string search object from the given pattern. |
|
BoyerMoore(byte[] pattern,
int offset,
int length)
Creates a precomputed Boyer-Moore byte string search object from a portion of the given pattern array. |
|
BoyerMoore(String pattern)
Creates a precomputed Boyer-Moore byte string search object from the given pattern. |
Method Summary | |
---|---|
int |
getPatternLength()
Returns the length of the pattern for this searcher. |
int |
search(byte[] byteString)
Search for the previously pre-compiled pattern string in an array of bytes. |
int |
search(byte[] byteString,
int offset,
int length)
Search for the previously pre-compiled pattern string in an array of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoyerMoore(String pattern)
pattern
are truncated if greater than 255, and converted in twos-complement
fashion, to appropriate negative byte values, if necessary.
This method is provided as a convenience for searching for patterns
within 8 bit byte strings composed of character data.
pattern
- The pattern create this object for.public BoyerMoore(byte[] pattern)
pattern
- Binary pattern to search for.public BoyerMoore(byte[] pattern, int offset, int length)
pattern
- Byte array containing a pattern to search for.offset
- Offset to beginning of search pattern.length
- Length of the search pattern.Method Detail |
---|
public int getPatternLength()
public int search(byte[] byteString)
byteString
- Array of bytes in which to search
for the pattern.
-1
if the pattern was not found.public int search(byte[] byteString, int offset, int length)
byteString
- Array of bytes in which to search
for the pattern.offset
- The the index in byteString
where the search is to begin.length
- The number of bytes to search in
byteString
.
-1
if the pattern was not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |