org.gjt.sp.jedit.search
Class BoyerMooreSearchMatcher
java.lang.Object
org.gjt.sp.jedit.search.SearchMatcher
org.gjt.sp.jedit.search.BoyerMooreSearchMatcher
public class BoyerMooreSearchMatcher
- extends SearchMatcher
Implements literal search using the Boyer-Moore algorithm.
Constructor Summary |
BoyerMooreSearchMatcher(java.lang.String pattern,
boolean ignoreCase)
Creates a new string literal matcher. |
Method Summary |
int |
match(java.lang.CharSequence text,
boolean reverse)
a good introduction to the Boyer-Moore fast string matching
algorithm may be found on Moore's website at:
http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/ |
SearchMatcher.Match |
nextMatch(java.lang.CharSequence text,
boolean start,
boolean end,
boolean firstTime,
boolean reverse)
Returns the offset of the first match of the specified text
within this matcher. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoyerMooreSearchMatcher
public BoyerMooreSearchMatcher(java.lang.String pattern,
boolean ignoreCase)
- Creates a new string literal matcher.
nextMatch
public SearchMatcher.Match nextMatch(java.lang.CharSequence text,
boolean start,
boolean end,
boolean firstTime,
boolean reverse)
- Returns the offset of the first match of the specified text
within this matcher.
- Specified by:
nextMatch
in class SearchMatcher
- Parameters:
text
- The text to search instart
- True if the start of the segment is the beginning of the
bufferend
- True if the end of the segment is the end of the bufferfirstTime
- If false and the search string matched at the start
offset with length zero, automatically find next matchreverse
- If true, searching will be performed in a backward
direction.
- Returns:
- an array where the first element is the start offset
of the match, and the second element is the end offset of
the match
- Since:
- jEdit 4.2pre4
match
public int match(java.lang.CharSequence text,
boolean reverse)
- a good introduction to the Boyer-Moore fast string matching
algorithm may be found on Moore's website at:
http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/
- Since:
- jEdit 4.3pre5