HighlightItem
Leave feedback
On this page
Inheritance: java.lang.Object
public class HighlightItem
Represents a highlight, a part of the text which is usually used to explain the context of the found text in the search functionality.
An instance of HighlightItem class is used as return value of Parser.getHighlight(int, boolean, com.groupdocs.parser.options.HighlightOptions) method, SearchResult.getLeftHighlightItem() and SearchResult.getRightHighlightItem() properties. See the usage examples there.
| Constructor | Description |
|---|---|
| HighlightItem(int position, String text) | Initializes a new instance of the HighlightItem class. |
| Method | Description |
|---|---|
| getPosition() | Gets the position in the document text. |
| getText() | Gets the text of the highlight. |
public HighlightItem(int position, String text)
Initializes a new instance of the HighlightItem class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| position | int | The position in the document text. |
| text | java.lang.String | The text of the highlight. |
public int getPosition()
Gets the position in the document text.
Returns: int - A zero-based index of the start position of the highlight.
public String getText()
Gets the text of the highlight.
Returns: java.lang.String - A string value that represents the text of the highlight.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.