当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
FinderFactory.WholeWordsBwdFinder (Editor Library) - NetBeans API Javadoc (Current Development Version)
org.netbeans.editor
Class FinderFactory.WholeWordsBwdFinder
java.lang.Object
org.netbeans.editor.FinderFactory.AbstractFinder
org.netbeans.editor.FinderFactory.GenericBwdFinder
org.netbeans.editor.FinderFactory.WholeWordsBwdFinder
- All Implemented Interfaces:
- Finder, FinderFactory.StringFinder
- Enclosing class:
- FinderFactory
public static final class FinderFactory.WholeWordsBwdFinder
- extends FinderFactory.GenericBwdFinder
- implements FinderFactory.StringFinder
String backward finder that finds whole words only.
There are some speed optimizations attemted.
Method Summary |
int |
getFoundLength()
Get the length of the found string. |
void |
reset()
Reset the finder |
protected int |
scan(char ch,
boolean lastChar)
This function decides if it found a desired string or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FinderFactory.WholeWordsBwdFinder
public FinderFactory.WholeWordsBwdFinder(BaseDocument doc,
String s,
boolean matchCase)
getFoundLength
public int getFoundLength()
- Description copied from interface:
FinderFactory.StringFinder
- Get the length of the found string. This is useful
for regular expressions, because the length of the regular
expression can be different than the length of the string
that matched the expression.
- Specified by:
getFoundLength
in interface FinderFactory.StringFinder
reset
public void reset()
- Description copied from class:
FinderFactory.AbstractFinder
- Reset the finder
- Specified by:
reset
in interface Finder
- Overrides:
reset
in class FinderFactory.AbstractFinder
scan
protected int scan(char ch,
boolean lastChar)
- Description copied from class:
FinderFactory.GenericBwdFinder
- This function decides if it found a desired string or not.
The function receives currently searched character and flag if it's
the last one that is searched or not.
- Specified by:
scan
in class FinderFactory.GenericBwdFinder
- Returns:
- if the function decides that
it found a desired string it sets
found = true
and returns
how many characters back the searched string begins in backward
direction (0 stands for current character). It is usually 0 as the
finder usually decides after the last required character but it's
not always the case e.g. for whole-words-only search it can be 1 or so.
If the string is not yet found it returns how many characters it should go
in backward direction (in this case it would usually be -1).
The next searched character will be that one requested.