Class Searcher


  • public class Searcher
    extends java.lang.Object
    This class implements search functionality. It is non-reentrant: each searcher instance must be used by a single thread.
    • Constructor Detail

      • Searcher

        public Searcher​(IProject project,
                        SearchExpression searchExpression)
        Create new searcher instance.
        Parameters:
        project - Current project
    • Method Detail

      • setThread

        public void setThread​(LongProcessThread thread)
        Set thread for checking interruption.
      • getSearchResults

        public java.util.List<SearchResultEntry> getSearchResults()
        Returns list of search results
      • search

        public void search()
                    throws java.lang.Exception
        Search for this.expression and return a list of results.
        Throws:
        java.lang.Exception - when searching files goes wrong
      • searchString

        public boolean searchString​(java.lang.String origText)
        Looks for an occurrence of the search string(s) in the supplied text string.
        Parameters:
        origText - The text string to search in
        Returns:
        True if the text string contains all search strings
      • searchString

        public boolean searchString​(java.lang.String origText,
                                    boolean collapseResults)
        Looks for an occurrence of the search string(s) in the supplied text string. IF matches are found, they are added to this.foundMatches.
        Parameters:
        origText - The text string to search in
        collapseResults - True if the adjacent results should be collapsed. This can happen on search, but not on replace.
        Returns:
        True if the text string contains all search strings
      • getFoundMatches

        public java.util.List<SearchMatch> getFoundMatches()
      • searchText

        public void searchText​(java.lang.String seg,
                               java.lang.String translation,
                               java.lang.String filename)