Class SearchResult

  • All Implemented Interfaces:
    java.lang.Comparable

    
    public final class SearchResult
     implements Comparable<T>
                        

    Represents a result found when searching for text.

    • Method Detail

      • create

         static SearchResult create(@NonNull() PdfDocument document, @IntRange(from = 0) int pageIndex, @NonNull() Range range, @IntRange(from = 0) int snippetLength)

        Creates an immutable search result with a preview snippet from page text

        Parameters:
        document - Document which contains the search result.
        pageIndex - 0-indexed page number of the result.
        range - Character range on the page marking the search result.
        snippetLength - Length of the preview snippet to extract.
        Returns:

        A search result extracted from the document.

      • create

         static SearchResult create(@NonNull() PdfDocument document, @NonNull() Annotation annotation, @NonNull() Range range, @IntRange(from = 0) int snippetLength)

        Create an immutable search result with a preview snippet from annotation text.

        Parameters:
        document - Document which contains the search result.
        annotation - Annotation containing the search result.
        range - Character range in annotation contents marking the search result.
        snippetLength - Length of the preview snippet to extract.
        Returns:

        A search result extracted from the document.