• public class Search
    extends Object

    A utility class to make searching a Sequence with many regex patterns easier.

    Since:
    1.4
    Author:
    David Huen
    • Method Detail

      • addPattern

        public void addPattern​(String patternString,
                               boolean overlap)
                        throws RegexException,
                               IllegalAlphabetException

        add a search pattern to the searches to be conducted by this object.

        Parameters:
        patternString - String representation of the pattern.
        overlap - if true, the search continues at the base following the start to the previous hit. If false, it continues at the base after the existing hit.
        Throws:
        RegexException - if the requested pattern is not valid
        IllegalAlphabetException - if the requested pattern is not valid
      • addPattern

        public void addPattern​(String label,
                               String patternString,
                               boolean overlap)
                        throws RegexException,
                               IllegalAlphabetException

        add a search pattern to the searches to be conducted by this object.

        Parameters:
        patternString - String representation of the pattern.
        overlap - if true, the search continues at the base following the start to the previous hit. If false, it continues at the base after the existing hit.
        Throws:
        RegexException - if the requested pattern is not valid
        IllegalAlphabetException - if the requested pattern is not valid
      • clearPatterns

        public void clearPatterns()

        remove all patterns from the pattern cache.

      • search

        public void search​(SymbolList seq)

        search the Sequence with the patterns already registered with this object.

      • search

        public void search​(SymbolList seq,
                           int loLimit,
                           int hiLimit)

        search part of the SymbolList with the patterns already registered with this object.

        Parameters:
        loLimit - low limit of search range.
        hiLimit - high limit of search range.