HighlightItem

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.

Constructors

Constructor Description
HighlightItem(int position, String text) Initializes a new instance of the HighlightItem class.

Methods

Method Description
getPosition() Gets the position in the document text.
getText() Gets the text of the highlight.

HighlightItem(int position, String text)

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.

getPosition()

public int getPosition()

Gets the position in the document text.

Returns: int - A zero-based index of the start position of the highlight.

getText()

public String getText()

Gets the text of the highlight.

Returns: java.lang.String - A string value that represents the text of the highlight.