Package hec.data
Interface ITextFilter
- All Known Implementing Classes:
TextFilter
public interface ITextFilter
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionString[][]
Filters an array of strings into subsets that are included and excluded by the filterString[][]
Filters an array of strings into subsets that are included and excluded by the filterString[]
String[]
getExcluded
(Iterable<String> text) Filters an array of strings and returns the subset excluded by the filterString[]
getExcluded
(String[] text) Filters an array of strings and returns the subset excluded by the filtergetFlags()
String[]
getIncluded
(Iterable<String> text) Filters an array of strings and returns the subset included by the filterString[]
getIncluded
(String[] text) Filters an array of strings and returns the subset included by the filterString[]
boolean
Determines whether the text filter includes the specified textvoid
setDotAll
(boolean dotAll) Sets the dot-all state for ALL filter elementsvoid
setElements
(String elementsStr) void
setElements
(String[] elements) void
setElements
(List<TextFilterElement> elements) void
setIgnoreCase
(boolean ignoreCase) Sets the ignore case state for ALL filter elementsvoid
setIgnoreWhitespace
(boolean ignoreWhitespace) Sets the ignore whitespace state for ALL filter elementsvoid
setMultiLine
(boolean multiLine) Sets the multi-line state for ALL filter elementsvoid
setUsesRegex
(boolean usesRegex) boolean
-
Field Details
-
INCLUDED
static final int INCLUDED- See Also:
-
EXCLUDED
static final int EXCLUDED- See Also:
-
-
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
- Parameters:
elements
- the filter elements to set
-
setElements
- Parameters:
elements
- the filter elements to set- Throws:
TextFilterException
-
setElements
- 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
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
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
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
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
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
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
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
-