public class SearchTextInLinesResult extends java.lang.Object implements java.lang.Comparable<SearchTextInLinesResult>
SearchTextInLines
Constructor and Description |
---|
SearchTextInLinesResult(java.lang.String foundText,
int foundAtAbsoluteIndex,
int foundAtLineNumber,
int foundAtLineIndex,
java.lang.String textFragmentBefore,
java.lang.String textFragmentAfter)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SearchTextInLinesResult otherInstance)
Compare the absolute index of this instance with the absolute index of another instance.
|
void |
dumpToStdout()
Dump the content of this instance to stdout.
|
int |
getFoundAtAbsoluteIndex()
Get the absolute index (0..n-1).
|
int |
getFoundAtLineIndex()
Get the index within the line (0..n-1).
|
int |
getFoundAtLineNumber()
Get the line number (1..n).
|
java.lang.String |
getFoundText()
Get the text which was found.
|
java.lang.String |
getTextFragmentAfter()
Get the text fragment after the search text, or an empty string if no such data is available.
|
java.lang.String |
getTextFragmentBefore()
Get the text fragment before the search text, or an empty string if no such data is available.
|
JsonObject |
toJsonObject()
Get a JSON object of this instance.
|
public SearchTextInLinesResult(java.lang.String foundText, int foundAtAbsoluteIndex, int foundAtLineNumber, int foundAtLineIndex, java.lang.String textFragmentBefore, java.lang.String textFragmentAfter)
foundText
- foundText the text which was foundfoundAtAbsoluteIndex
- the absolute index (0..n-1)foundAtLineNumber
- the line number (1..n)foundAtLineIndex
- the index within the line (0..n-1)textFragmentBefore
- the text fragment before the search text, or pass an empty string if no such data are availabletextFragmentAfter
- the text fragment after the search text, or pass an empty string if no such data are availablejava.lang.IllegalArgumentException
- if invalid data are passedpublic java.lang.String getFoundText()
public int getFoundAtAbsoluteIndex()
public int getFoundAtLineNumber()
public int getFoundAtLineIndex()
public java.lang.String getTextFragmentBefore()
public java.lang.String getTextFragmentAfter()
public JsonObject toJsonObject()
public void dumpToStdout()
public int compareTo(SearchTextInLinesResult otherInstance)
compareTo
in interface java.lang.Comparable<SearchTextInLinesResult>
otherInstance
- the other instance