java.lang.Object
org.gjt.sp.jedit.search.SearchMatcher
org.gjt.sp.jedit.search.BoyerMooreSearchMatcher
Implements literal search using the Boyer-Moore algorithm.
- Version:
- $Id: BoyerMooreSearchMatcher.java 25302 2020-05-02 16:53:25Z kpouer $
-
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
ConstructorsConstructorDescriptionBoyerMooreSearchMatcher(String pattern, boolean ignoreCase) Creates a new string literal matcher.BoyerMooreSearchMatcher(String pattern, boolean ignoreCase, boolean wholeWord) Creates a new string literal matcher. -
Method Summary
Modifier and TypeMethodDescriptionintmatch(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/nextMatch(CharSequence text, boolean start, boolean end, boolean firstTime, boolean reverse) Returns the offset of the first match of the specified text within this matcher.toString()Methods inherited from class org.gjt.sp.jedit.search.SearchMatcher
isWholeWord, setNoWordSep
-
Constructor Details
-
BoyerMooreSearchMatcher
Creates a new string literal matcher.- Parameters:
pattern- the search patternignoreCase-trueif you want to ignore case
-
BoyerMooreSearchMatcher
Creates a new string literal matcher.- Parameters:
pattern- the search patternignoreCase-trueif you want to ignore casewholeWord-trueto search for whole word only- Since:
- 4.5pre1
-
-
Method Details
-
nextMatch
public SearchMatcher.Match nextMatch(CharSequence text, boolean start, boolean end, boolean firstTime, boolean reverse) throws InterruptedException Description copied from class:SearchMatcherReturns the offset of the first match of the specified text within this matcher.- Specified by:
nextMatchin 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.Matchobject. - Throws:
InterruptedException
-
match
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:
InterruptedException- Since:
- jEdit 4.3pre5
-
toString
-