java.lang.Object
org.gjt.sp.jedit.search.SearchMatcher
- Direct Known Subclasses:
BoyerMooreSearchMatcher
,PatternSearchMatcher
An abstract class for matching strings.
- Version:
- $Id: SearchMatcher.java 25301 2020-05-01 16:38:04Z kpouer $
- Author:
- Slava Pestov
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
This should contains the noWordSep property of the edit mode of your buffer.protected SearchMatcher.Match
protected boolean
true if this SearchMatcher search for whole words only. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isWholeWord
(CharSequence text, int start, int end) Check if the result is a whole wordabstract SearchMatcher.Match
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.void
setNoWordSep
(String noWordSep)
-
Field Details
-
returnValue
-
wholeWord
protected boolean wholeWordtrue if this SearchMatcher search for whole words only. -
noWordSep
This should contains the noWordSep property of the edit mode of your buffer. It contains a list of chars that should be considered as word chars
-
-
Constructor Details
-
SearchMatcher
protected SearchMatcher()
-
-
Method Details
-
nextMatch
public abstract SearchMatcher.Match nextMatch(CharSequence text, boolean start, boolean end, boolean firstTime, boolean reverse) throws InterruptedException Returns the offset of the first match of the specified text within this matcher.- 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:
InterruptedException
- Since:
- jEdit 4.3pre5
-
setNoWordSep
- Parameters:
noWordSep
- the chars that are considered as word chars for this search- Since:
- jEdit 4.5pre1
-
isWholeWord
Check if the result is a whole word- Parameters:
text
- the full text searchstart
- the start matchend
- the end match- Returns:
- true if the word is a whole word
-