Class AbstractPatternTextFilter

java.lang.Object
docking.widgets.filter.AbstractPatternTextFilter
All Implemented Interfaces:
TextFilter
Direct Known Subclasses:
FindsPatternTextFilter, MatchesPatternTextFilter

public abstract class AbstractPatternTextFilter extends Object implements TextFilter
  • Field Details

    • filterText

      protected final String filterText
    • filterPattern

      protected Pattern filterPattern
  • Constructor Details

    • AbstractPatternTextFilter

      protected AbstractPatternTextFilter(String filterText)
  • Method Details

    • createPattern

      protected abstract Pattern createPattern()
      Subclasses must create the Pattern that will be used by this class when filtering.
      Returns:
      the pattern
    • matches

      public abstract boolean matches(String text, Pattern pattern)
      Subclasses implement this method for their usage of the given pattern (find vs. matches)
      Parameters:
      text - the text to check against the pattern
      pattern - the pattern used to match the text
      Returns:
      true if there is a match
    • getFilterText

      public String getFilterText()
      Specified by:
      getFilterText in interface TextFilter
    • matches

      public boolean matches(String text)
      Specified by:
      matches in interface TextFilter
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object