public final class SearchResult extends Object
Provides the result of the search.
Constructor and Description |
---|
SearchResult(int index,
String foundText)
Initializes a new instance of the
SearchResult class. |
SearchResult(int index,
String foundText,
String leftText,
String rightText)
Initializes a new instance of the
SearchResult class. |
Modifier and Type | Method and Description |
---|---|
SearchResult |
addPosition(int position)
Creates a new instance of
SearchResult with a new position. |
String |
getFoundText()
Gets a found text.
|
int |
getIndex()
Gets an index of the found text.
|
String |
getLeftText()
Gets a text on the left side of the found text.
|
String |
getRightText()
Gets a text on the right side of the found text.
|
public SearchResult(int index, String foundText)
Initializes a new instance of the SearchResult
class.
index
- An index of the found text.foundText
- A found text.public SearchResult(int index, String foundText, String leftText, String rightText)
Initializes a new instance of the SearchResult
class.
index
- An index of the found text.foundText
- A found text.leftText
- A text on the left side of the found text.rightText
- A text on the right side of the found text.public String getLeftText()
Gets a text on the left side of the found text.
public String getRightText()
Gets a text on the right side of the found text.
public String getFoundText()
Gets a found text.
public int getIndex()
Gets an index of the found text.
public SearchResult addPosition(int position)
Creates a new instance of SearchResult
with a new position.
position
- An increment to the current position.SearchResult
with a new position.