public class KMPSearch
extends Object
See http://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm.
Constructor and Description |
---|
KMPSearch() |
Modifier and Type | Method and Description |
---|---|
static int[] |
generateNexts(byte[] pattern) |
static int[] |
generateNexts(char[] pattern) |
static int[] |
generateNexts(CharSequence pattern) |
static int |
search(byte[] text,
byte[] pattern) |
static int |
search(byte[] text,
byte[] pattern,
int[] nexts) |
static int |
search(byte[] text,
int offset,
byte[] pattern,
int[] nexts) |
static int |
search(byte[] text,
int offset,
int length,
byte[] pattern,
int[] nexts) |
static int |
search(char[] text,
char[] pattern) |
static int |
search(char[] text,
char[] pattern,
int[] nexts) |
static int |
search(char[] text,
int offset,
char[] pattern,
int[] nexts) |
static int |
search(char[] text,
int offset,
int length,
char[] pattern,
int[] nexts) |
static int |
search(CharSequence text,
CharSequence pattern) |
static int |
search(CharSequence text,
CharSequence pattern,
int[] nexts) |
static int |
search(CharSequence text,
int offset,
CharSequence pattern,
int[] nexts) |
static int |
search(CharSequence text,
int offset,
int length,
CharSequence pattern,
int[] nexts) |
public static int[] generateNexts(byte[] pattern)
public static int[] generateNexts(char[] pattern)
public static int[] generateNexts(CharSequence pattern)
public static int search(byte[] text, byte[] pattern)
public static int search(byte[] text, byte[] pattern, int[] nexts)
public static int search(byte[] text, int offset, byte[] pattern, int[] nexts)
public static int search(byte[] text, int offset, int length, byte[] pattern, int[] nexts)
public static int search(char[] text, char[] pattern)
public static int search(char[] text, char[] pattern, int[] nexts)
public static int search(char[] text, int offset, char[] pattern, int[] nexts)
public static int search(char[] text, int offset, int length, char[] pattern, int[] nexts)
public static int search(CharSequence text, CharSequence pattern)
public static int search(CharSequence text, CharSequence pattern, int[] nexts)
public static int search(CharSequence text, int offset, CharSequence pattern, int[] nexts)
public static int search(CharSequence text, int offset, int length, CharSequence pattern, int[] nexts)