Class TextFilterElement

java.lang.Object
hec.data.textFilter.TextFilterElement

public class TextFilterElement extends Object
  • Field Details

    • TEXT_FILTER_ELEMENT_REGEX

      public static final String TEXT_FILTER_ELEMENT_REGEX
      See Also:
    • TEXT_FILTER_ELEMENT_PATTERN

      public static final Pattern TEXT_FILTER_ELEMENT_PATTERN
  • Constructor Details

    • TextFilterElement

      public TextFilterElement()
      Default Constructor
    • TextFilterElement

      public TextFilterElement(boolean include, String filterText, boolean usesRegex, boolean multiLine, boolean dotAll, boolean ignoreWhitespace, boolean ignoreCase)
      Constructor from data parts
      Parameters:
      include - specifies whether this element is an include element
      filterText - the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter element
      usesRegex - specifies whether the filter element uses regular expression matching
      multiLine - specifies whether the filter element can match multiple lines (TEXT_FILTER_ELEMENT_REGEX only)
      dotAll - specifies whether the dot '.' pattern character can match a newline character (TEXT_FILTER_ELEMENT_REGEX only)
      ignoreWhitespace - specifies whether whitespace in the pattern is ignored (TEXT_FILTER_ELEMENT_REGEX only)
      ignoreCase - specifies whether the filter element uses case insensitive matching
    • TextFilterElement

      public TextFilterElement(String elementText, boolean usesRegex) throws TextFilterException
      Constructor from text representation
      Parameters:
      elementText - the text representation
      usesRegex - specifies whether the filter element uses regular expression matching
      Throws:
      TextFilterException
  • Method Details

    • isInclude

      protected boolean isInclude()
      Returns:
      whether this element is an include element
    • setInclude

      protected void setInclude(boolean include)
      Parameters:
      include - specifies whether this element is an include element
    • usesRegex

      protected boolean usesRegex()
      Returns:
      whether the filter element uses regular expression matching
    • setUsesRegex

      protected void setUsesRegex(boolean usesRegex)
      Parameters:
      usesRegex - specifies whether the filter element uses regular expression matching
    • isMultiLine

      protected boolean isMultiLine()
      Returns:
      whether the filter element can match multiple lines (TEXT_FILTER_ELEMENT_REGEX only)
    • setMultiLine

      protected void setMultiLine(boolean multiLine)
      Parameters:
      multiLine - specifies whether the filter element can match multiple lines (TEXT_FILTER_ELEMENT_REGEX only)
    • isDotAll

      protected boolean isDotAll()
      Returns:
      whether the dot '.' pattern character can match a newline character (TEXT_FILTER_ELEMENT_REGEX only)
    • setDotAll

      protected void setDotAll(boolean dotAll)
      Parameters:
      dotAll - specifies whether the dot '.' pattern character can match a newline character (TEXT_FILTER_ELEMENT_REGEX only)
    • isIgnoreWhitespace

      protected boolean isIgnoreWhitespace()
      Returns:
      whether whitespace in the pattern is ignored (TEXT_FILTER_ELEMENT_REGEX only)
    • setIgnoreWhitespace

      protected void setIgnoreWhitespace(boolean ignoreWhitespace)
      Parameters:
      ignoreWhitespace - specifies whether whitespace in the pattern is ignored (TEXT_FILTER_ELEMENT_REGEX only)
    • isIgnoreCase

      protected boolean isIgnoreCase()
      Returns:
      whether the filter element uses case insensitive matching
    • setIgnoreCase

      protected void setIgnoreCase(boolean ignoreCase)
      Parameters:
      ignoreCase - specifies whether the filter element uses case insensitive matching
    • getFilterText

      protected String getFilterText()
      Returns:
      the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter element
    • setFilterText

      protected void setFilterText(String filterText)
      Parameters:
      filterText - the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter element
    • setData

      protected void setData(boolean include, String filterText, boolean usesRegex, boolean multiLine, boolean dotAll, boolean ignoreWhitespace, boolean ignoreCase)
      Populates and initializes the filter element
      Parameters:
      include - specifies whether this element is an include element
      filterText - the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter element
      usesRegex - specifies whether the filter element uses regular expression matching
      multiLine - specifies whether the filter element can match multiple lines (TEXT_FILTER_ELEMENT_REGEX only)
      dotAll - specifies whether the dot '.' pattern character can match a newline character (TEXT_FILTER_ELEMENT_REGEX only)
      ignoreWhitespace - specifies whether whitespace in the pattern is ignored (TEXT_FILTER_ELEMENT_REGEX only)
      ignoreCase - specifies whether the filter element uses case insensitive matching
    • setData

      protected void setData(String elementText, boolean usesRegex) throws TextFilterException
      Populates and initializes the filter element from a text representation
      Parameters:
      elementText - the text representation
      usesRegex - specifies whether the filter element uses regular expression matching
      Throws:
      TextFilterException
    • init

      protected void init()
      Initializes the element so that it can be used for matching
    • matches

      protected boolean matches(CharSequence str) throws TextFilterException
      Determines whether the filter element matches the specified text
      Parameters:
      str - the specified text
      Returns:
      whether the filter element matches the specified text
      Throws:
      TextFilterException - if the element is not initialized
    • toString

      public String toString()
      Overrides:
      toString in class Object