public abstract class TextFinder extends Object implements Finder, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected int |
endIndex |
protected boolean |
negative |
protected CharSequence |
text |
| Constructor and Description |
|---|
TextFinder() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getValidEndIndex()
获取有效结束位置
如果
endIndex小于0,在反向模式下是开头(-1),正向模式是结尾(text.length()) |
TextFinder |
setEndIndex(int endIndex)
设置查找的结束位置
如果从前向后查找,结束位置最大为text.length()
如果从后向前,结束位置为-1
|
TextFinder |
setNegative(boolean negative)
设置是否反向查找,
true表示从后向前查找 |
TextFinder |
setText(CharSequence text)
设置被查找的文本
|
protected CharSequence text
protected boolean negative
protected int endIndex
public TextFinder setText(CharSequence text)
text - 文本public TextFinder setNegative(boolean negative)
true表示从后向前查找negative - 结束位置(不包括)public TextFinder setEndIndex(int endIndex)
endIndex - 结束位置(不包括)protected int getValidEndIndex()
endIndex小于0,在反向模式下是开头(-1),正向模式是结尾(text.length())Copyright © 2022. All rights reserved.