Package hec.data

Interface ITextFilter

All Known Implementing Classes:
TextFilter

public interface ITextFilter
  • Field Details

  • Method Details

    • usesRegex

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

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

      List<TextFilterElement> getElements()
      Returns:
      a copy of the filter elements
    • getElementStrings

      String[] getElementStrings()
      Returns:
      a copy of the filter elements as individual strings
    • getNormalizedElementStrings

      String[] getNormalizedElementStrings()
      Returns:
      a copy of the filter elements as individual strings, with common flags removed
    • getElementsString

      String getElementsString()
      Returns:
      a copy of the filter elements as a single multi-line string
    • getNormalizedElementsString

      String getNormalizedElementsString()
      Returns:
      a copy of the filter elements as a single multi-line string, each line having common flags removed
    • setElements

      void setElements(List<TextFilterElement> elements)
      Parameters:
      elements - the filter elements to set
    • setElements

      void setElements(String[] elements) throws TextFilterException
      Parameters:
      elements - the filter elements to set
      Throws:
      TextFilterException
    • setElements

      void setElements(String elementsStr) throws TextFilterException
      Parameters:
      elementsStr - the filter elements to set in a single multi-line string
      Throws:
      TextFilterException
    • setMultiLine

      void setMultiLine(boolean multiLine)
      Sets the multi-line state for ALL filter elements
      Parameters:
      multiLine - specifies whether the filter element can match multiple lines (regex only)
    • setDotAll

      void setDotAll(boolean dotAll)
      Sets the dot-all state for ALL filter elements
      Parameters:
      dotAll - specifies whether the dot '.' pattern character can match a newline character (regex only)
    • setIgnoreWhitespace

      void setIgnoreWhitespace(boolean ignoreWhitespace)
      Sets the ignore whitespace state for ALL filter elements
      Parameters:
      ignoreWhitespace - specifies whether whitespace in the pattern is ignored (regex only)
    • setIgnoreCase

      void setIgnoreCase(boolean ignoreCase)
      Sets the ignore case state for ALL filter elements
      Parameters:
      ignoreCase - specifies whether the filter element uses case insensitive matching
    • includes

      boolean includes(String text) throws TextFilterException
      Determines whether the text filter includes the specified text
      Parameters:
      text - the text to pass through the filter
      Returns:
      whether the text filter includes the specified text
      Throws:
      TextFilterException
    • filter

      String[][] filter(String[] text) throws TextFilterException
      Filters an array of strings into subsets that are included and excluded by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      a couple comprising the filtered subsets in the order included, excluded
      Throws:
      TextFilterException
    • filter

      String[][] filter(Iterable<String> text) throws TextFilterException
      Filters an array of strings into subsets that are included and excluded by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      a couple comprising the filtered subsets in the order included, excluded
      Throws:
      TextFilterException
    • getIncluded

      String[] getIncluded(String[] text) throws TextFilterException
      Filters an array of strings and returns the subset included by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      the subset of strings included by the filter
      Throws:
      TextFilterException
    • getIncluded

      String[] getIncluded(Iterable<String> text) throws TextFilterException
      Filters an array of strings and returns the subset included by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      the subset of strings included by the filter
      Throws:
      TextFilterException
    • getExcluded

      String[] getExcluded(String[] text) throws TextFilterException
      Filters an array of strings and returns the subset excluded by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      the subset of strings excluded by the filter
      Throws:
      TextFilterException
    • getExcluded

      String[] getExcluded(Iterable<String> text) throws TextFilterException
      Filters an array of strings and returns the subset excluded by the filter
      Parameters:
      text - the array of strings to filter
      Returns:
      the subset of strings excluded by the filter
      Throws:
      TextFilterException
    • getFlags

      String getFlags()
      Returns:
      the set of flags set on all elements