Package hec.data.textFilter
Class TextFilterElement
java.lang.Object
hec.data.textFilter.TextFilterElement
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorTextFilterElement
(boolean include, String filterText, boolean usesRegex, boolean multiLine, boolean dotAll, boolean ignoreWhitespace, boolean ignoreCase) Constructor from data partsTextFilterElement
(String elementText, boolean usesRegex) Constructor from text representation -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected void
init()
Initializes the element so that it can be used for matchingprotected boolean
isDotAll()
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
matches
(CharSequence str) Determines whether the filter element matches the specified textprotected void
setData
(boolean include, String filterText, boolean usesRegex, boolean multiLine, boolean dotAll, boolean ignoreWhitespace, boolean ignoreCase) Populates and initializes the filter elementprotected void
Populates and initializes the filter element from a text representationprotected void
setDotAll
(boolean dotAll) protected void
setFilterText
(String filterText) protected void
setIgnoreCase
(boolean ignoreCase) protected void
setIgnoreWhitespace
(boolean ignoreWhitespace) protected void
setInclude
(boolean include) protected void
setMultiLine
(boolean multiLine) protected void
setUsesRegex
(boolean usesRegex) toString()
protected boolean
-
Field Details
-
TEXT_FILTER_ELEMENT_REGEX
- See Also:
-
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 elementfilterText
- the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter elementusesRegex
- specifies whether the filter element uses regular expression matchingmultiLine
- 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
Constructor from text representation- Parameters:
elementText
- the text representationusesRegex
- 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
- Returns:
- the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter element
-
setFilterText
- 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 elementfilterText
- the text matching pattern (glob or TEXT_FILTER_ELEMENT_REGEX) of the filter elementusesRegex
- specifies whether the filter element uses regular expression matchingmultiLine
- 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
Populates and initializes the filter element from a text representation- Parameters:
elementText
- the text representationusesRegex
- 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
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
-