Class DefaultSequenceFinder

    • Constructor Detail

      • DefaultSequenceFinder

        public DefaultSequenceFinder​(String pattern,
                                     String sourceText)
        Constructor
        Parameters:
        pattern - pattern for finding char sequence, can't be null
        sourceText - initial text for finding by pattern, can't be null
    • Method Detail

      • isSourceTextStartWithPattern

        protected boolean isSourceTextStartWithPattern​(String pattern,
                                                       String sourceText)
        Checks that sourceText starts with pattern
        Parameters:
        pattern - pattern for finding char sequence, can't be null
        sourceText - initial text for finding by pattern, can't be null
        Returns:
        true if sourceText starts with pattern, false otherwise
      • findStartIndexOfNextWord

        protected int findStartIndexOfNextWord​(int startSearchingIndex,
                                               String findIn)
        Description copied from class: AbstractSequenceFinder
        Finds start index of next word in string findIn, begins with startSearchingIndex
        Specified by:
        findStartIndexOfNextWord in class AbstractSequenceFinder
        Parameters:
        startSearchingIndex - start index for search
        findIn - initial text for finding index of next word, can't be null
        Returns:
        start index of next word, if the word was found, or findIn.length() otherwise