Class FindsPatternTextFilter

  • All Implemented Interfaces:
    TextFilter

    public class FindsPatternTextFilter
    extends AbstractPatternTextFilter
    A text filter that uses a pattern and performs a 'find' using that pattern.
    • Constructor Summary

      Constructors 
      Constructor Description
      FindsPatternTextFilter​(java.lang.String filterText)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.regex.Pattern createPattern()
      Subclasses must create the Pattern that will be used by this class when filtering.
      boolean isSubFilterOf​(TextFilter parentFilter)
      Returns true if this filter is a more specific filter of the given filter.
      boolean matches​(java.lang.String text, java.util.regex.Pattern pattern)
      Subclasses implement this method for their usage of the given pattern (find vs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FindsPatternTextFilter

        public FindsPatternTextFilter​(java.lang.String filterText)
    • Method Detail

      • matches

        public boolean matches​(java.lang.String text,
                               java.util.regex.Pattern pattern)
        Description copied from class: AbstractPatternTextFilter
        Subclasses implement this method for their usage of the given pattern (find vs. matches)
        Specified by:
        matches in class AbstractPatternTextFilter
        Parameters:
        text - the text to check against the pattern
        pattern - the pattern used to match the text
        Returns:
        true if there is a match
      • isSubFilterOf

        public boolean isSubFilterOf​(TextFilter parentFilter)
        Description copied from interface: TextFilter
        Returns true if this filter is a more specific filter of the given filter. This is specific to the implementation. Some filters cannot be sub-filters of another filter, such as the 'matches exactly' filter. Contrastingly, a 'starts with' filter can have a sub-filter; for example, for a 'starts with' filter, 'cat' is a sub-filter of 'ca', as 'cat' starts with 'ca'.
        Parameters:
        parentFilter - the potential parent filter
        Returns:
        true if this filter is a more specific filter of the given filter.