Package 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.gjt.sp.jedit.search.SearchMatcher
SearchMatcher.Match
-
-
Field Summary
-
Fields inherited from class org.gjt.sp.jedit.search.SearchMatcher
noWordSep, returnValue, wholeWord
-
-
Constructor Summary
Constructors Constructor Description BoyerMooreSearchMatcher(java.lang.String pattern, boolean ignoreCase)
Creates a new string literal matcher.BoyerMooreSearchMatcher(java.lang.String pattern, boolean ignoreCase, boolean wholeWord)
Creates a new string literal matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.String
toString()
-
Methods inherited from class org.gjt.sp.jedit.search.SearchMatcher
isWholeWord, setNoWordSep
-
-
-
-
Constructor Detail
-
BoyerMooreSearchMatcher
public BoyerMooreSearchMatcher(java.lang.String pattern, boolean ignoreCase)
Creates a new string literal matcher.- Parameters:
pattern
- the search patternignoreCase
-true
if you want to ignore case
-
BoyerMooreSearchMatcher
public BoyerMooreSearchMatcher(java.lang.String pattern, boolean ignoreCase, boolean wholeWord)
Creates a new string literal matcher.- Parameters:
pattern
- the search patternignoreCase
-true
if you want to ignore casewholeWord
-true
to search for whole word only- Since:
- 4.5pre1
-
-
Method Detail
-
nextMatch
public SearchMatcher.Match nextMatch(java.lang.CharSequence text, boolean start, boolean end, boolean firstTime, boolean reverse) throws java.lang.InterruptedException
Description copied from class:SearchMatcher
Returns the offset of the first match of the specified text within this matcher.- Specified by:
nextMatch
in classSearchMatcher
- Parameters:
text
- The text to search instart
- True if the start of the text is the beginning of a lineend
- True if the end of the text is the end of a linefirstTime
- 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:
- A
SearchMatcher.Match
object. - Throws:
java.lang.InterruptedException
-
match
public int match(java.lang.CharSequence text, boolean reverse) throws java.lang.InterruptedException
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/- Throws:
java.lang.InterruptedException
- Since:
- jEdit 4.3pre5
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-