com.groupdocs.parser

Interfaces

Classes

Exceptions

com.groupdocs.parser

Class SearchResult



  • public final class SearchResult
    extends Object

    Provides the result of the search.

    • Constructor Detail

      • SearchResult

        public SearchResult(int index,
                    String foundText)

        Initializes a new instance of the SearchResult class.

        Parameters:
        index - An index of the found text.
        foundText - A found text.
      • SearchResult

        public SearchResult(int index,
                    String foundText,
                    String leftText,
                    String rightText)

        Initializes a new instance of the SearchResult class.

        Parameters:
        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.
    • Method Detail

      • getLeftText

        public String getLeftText()

        Gets a text on the left side of the found text.

        Returns:
        A text on the left side of the found text.
      • getRightText

        public String getRightText()

        Gets a text on the right side of the found text.

        Returns:
        A text on the right side of the found text.
      • getFoundText

        public String getFoundText()

        Gets a found text.

        Returns:
        A found text.
      • getIndex

        public int getIndex()

        Gets an index of the found text.

        Returns:
        An index of the found text.
      • addPosition

        public SearchResult addPosition(int position)

        Creates a new instance of SearchResult with a new position.

        Parameters:
        position - An increment to the current position.
        Returns:
        An instance of SearchResult with a new position.