| |
|
| java.lang.Object cmp.Boyer.Boyer
Boyer | public class Boyer (Code) | | |
Constructor Summary | |
public | Boyer() default constructor. | public | Boyer(String text) constructor that also
sets text to search in for subsequent indexOf searches.
Must also provide a pattern before using indexOf with setPattern.
Parameters: text - String to search in. | public | Boyer(char[] text) constructor that also
sets text to search in for subsequent indexOf searches.
Must also provide a pattern before using indexOf with setPattern.
Parameters: text - char array to search in. |
Method Summary | |
public static int | indexOf(String text, String pattern) Search for given pattern in string.
Parameters: text - String to search in. | public static int | indexOf(char[] text, String pattern) Search for given pattern in char array
Parameters: text - char array to search in. | public int | indexOf(String pattern) Search for given pattern in string.
Text must have been set previously by the constructor or setText.
Parameters: pattern - String to search for. | final public int | indexOf() Search for given pattern in String or char array. | public static void | main(String[] args) | public void | setPattern(String pattern) Set pattern to use for subsequent indexOf searches.
Parameters: pattern - String to search for. | public void | setText(String text) Set text to search in for subsequent indexOf searches.
Parameters: text - String to search in. | public void | setText(char[] text) Set text to search in for subsequent indexOf searches.
Parameters: text - char array to search in. |
Boyer | public Boyer()(Code) | | default constructor. Must use setText and setPattern afterward.
|
Boyer | public Boyer(String text)(Code) | | constructor that also
sets text to search in for subsequent indexOf searches.
Must also provide a pattern before using indexOf with setPattern.
Parameters: text - String to search in. may be "" but not null. |
Boyer | public Boyer(char[] text)(Code) | | constructor that also
sets text to search in for subsequent indexOf searches.
Must also provide a pattern before using indexOf with setPattern.
Parameters: text - char array to search in. may be 0-length but not null. |
indexOf | public static int indexOf(String text, String pattern)(Code) | | Search for given pattern in string.
Parameters: text - String to search in. May be "" but not null. Parameters: pattern - String to search for. May be "" but not null. 0-based offset in text, just like String.indexOf.-1 means not found. |
indexOf | public static int indexOf(char[] text, String pattern)(Code) | | Search for given pattern in char array
Parameters: text - char array to search in. May be "" but not null. Parameters: pattern - String to search for. May be "" but not null. 0-based offset in text, just like String.indexOf.-1 means not found. |
indexOf | public int indexOf(String pattern)(Code) | | Search for given pattern in string.
Text must have been set previously by the constructor or setText.
Parameters: pattern - String to search for. May be "" but not null. 0-based offset in text, just like String.indexOf.-1 means not found. |
indexOf | final public int indexOf()(Code) | | Search for given pattern in String or char array.
Presume Pattern and Text have been previously set either
with the constructor or with setText setPattern.
0-based offset in text, just like String.indexOf.-1 means not found. |
main | public static void main(String[] args)(Code) | | test harness
|
setPattern | public void setPattern(String pattern)(Code) | | Set pattern to use for subsequent indexOf searches.
Parameters: pattern - String to search for. May be "" but not null.. |
setText | public void setText(String text)(Code) | | Set text to search in for subsequent indexOf searches.
Parameters: text - String to search in. May be "" but not null. |
setText | public void setText(char[] text)(Code) | | Set text to search in for subsequent indexOf searches.
Parameters: text - char array to search in. May be empty but not null. |
|
|
|