public class CPDFTextSearcher extends java.lang.Object implements ITextSearcher
| Constructor and Description | 
|---|
| CPDFTextSearcher(android.content.Context context,
                CPDFDocument document) | 
| CPDFTextSearcher(android.content.Context context,
                CPDFReaderView readerView) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | cancelSearch()Stop searching. | 
| int | getCurrentPageIndex()Gets the page index that is being searched currently | 
| java.util.ArrayList<android.graphics.RectF> | getSelectedSelections()Gets the position of keyword that is in focus state currently. | 
| java.util.ArrayList<android.graphics.RectF> | getSelections(int pageIndex)Gets the position of all keywords in specify page index. | 
| boolean | isIgnoreCase()Whether to ignore the capitalization when searching. | 
| boolean | isMatchWholeWord()Whether to match the whole word when searching. | 
| void | searchBackward()Search backward. | 
| void | searchBegin(int pageIndex,
           int textRangeIndex)Sets the searcher to start searching from the  textRangeIndexkeyword inpageIndexpage | 
| void | searchForward()Search forward. | 
| java.util.ArrayList<CPDFTextRange> | searchKeyword(int pageIndex)Searches keyword in the page index, get position information of all keywords, more:  CPDFTextRange | 
| void | setIgnoreCase(boolean ignore)Set whether to ignore the capitalization when searching. | 
| void | setMatchWholeWord(boolean matchWhole)Set whether to match the whole word when searching. | 
| void | setSearchConfig(java.lang.String keyword,
               int searchMode)Sets the keyword and search mode of searcher | 
public CPDFTextSearcher(android.content.Context context,
                        CPDFReaderView readerView)
public CPDFTextSearcher(android.content.Context context,
                        CPDFDocument document)
public java.util.ArrayList<android.graphics.RectF> getSelections(int pageIndex)
A keyword may correspond to multiple rectangles, because if a keyword wraps, there will be multiple rectangles corresponding to a keyword
getSelections in interface ITextSearcherpageIndex - Page number.pageIndex pagepublic java.util.ArrayList<android.graphics.RectF> getSelectedSelections()
getSelectedSelections in interface ITextSearcherpublic int getCurrentPageIndex()
getCurrentPageIndex in interface ITextSearcherpublic void setSearchConfig(java.lang.String keyword,
                            int searchMode)
setSearchConfig in interface ITextSearcherkeyword - KeywordsearchMode - Search mode, more: CPDFTextSearcher.PDFSearchOptionspublic void setIgnoreCase(boolean ignore)
setIgnoreCase in interface ITextSearcherignore - Whether to ignore the capitalization.public void setMatchWholeWord(boolean matchWhole)
setMatchWholeWord in interface ITextSearchermatchWhole - Whether to match the whole word.public boolean isIgnoreCase()
isIgnoreCase in interface ITextSearcherpublic boolean isMatchWholeWord()
isMatchWholeWord in interface ITextSearcherpublic void searchBegin(int pageIndex,
                        int textRangeIndex)
textRangeIndex keyword in pageIndex pagesearchBegin in interface ITextSearcherpageIndex - Start page index.textRangeIndex - Start keyword index.public java.util.ArrayList<CPDFTextRange> searchKeyword(int pageIndex)
CPDFTextRangesearchKeyword in interface ITextSearcherpageIndex - Page index.public void searchForward()
searchForward in interface ITextSearcherpublic void searchBackward()
searchBackward in interface ITextSearcherpublic void cancelSearch()
cancelSearch in interface ITextSearcher