cascading.operation.regex
Class RegexFilter
java.lang.Object
cascading.operation.BaseOperation<C>
cascading.operation.regex.RegexOperation<Matcher>
cascading.operation.regex.RegexMatcher
cascading.operation.regex.RegexFilter
- All Implemented Interfaces:
- DeclaresResults, Filter<Matcher>, Operation<Matcher>, Traceable, Serializable
public class RegexFilter
- extends RegexMatcher
- implements Filter<Matcher>
Class RegexFilter will apply the regex patternString against every input Tuple value and filter
the Tuple stream accordingly.
By default, Tuples that match the given pattern are kept, and Tuples that do not
match are filtered out. This can be changed by setting removeMatch to true.
Also, by default, the whole Tuple is matched against the given patternString (tab delimited). If matchEachElement
is set to true, the pattern is applied to each Tuple value individually.
This operation uses Matcher
internally, specifically the method Matcher.find()
.
Note a null
valued argument passed to the parser will be converted to an empty string (""
) before
the regex is applied.
Any Object value will be coerced to a String type via its toString()
method.
- See Also:
Matcher
,
Pattern
,
Serialized Form
Fields inherited from interface cascading.operation.Operation |
ANY |
Constructor Summary |
RegexFilter(String patternString)
Constructor RegexFilter creates a new RegexFilter instance. |
RegexFilter(String patternString,
boolean removeMatch)
Constructor RegexFilter creates a new RegexFilter instance. |
RegexFilter(String patternString,
boolean removeMatch,
boolean matchEachElement)
|
matchEachElement
protected final boolean matchEachElement
- Field matchEachElement
RegexFilter
@ConstructorProperties(value="patternString")
public RegexFilter(String patternString)
- Constructor RegexFilter creates a new RegexFilter instance.
- Parameters:
patternString
- of type String
RegexFilter
@ConstructorProperties(value={"patternString","removeMatch"})
public RegexFilter(String patternString,
boolean removeMatch)
- Constructor RegexFilter creates a new RegexFilter instance.
- Parameters:
patternString
- of type StringremoveMatch
- of type boolean
RegexFilter
@ConstructorProperties(value={"patternString","removeMatch","matchEachElement"})
public RegexFilter(String patternString,
boolean removeMatch,
boolean matchEachElement)
- Parameters:
patternString
- of type StringremoveMatch
- of type boolean, set to true if a match should be filteredmatchEachElement
- of type boolean, set to true if each element should be matched individually
isMatchEachElement
public boolean isMatchEachElement()
isRemove
public boolean isRemove(FlowProcess flowProcess,
FilterCall<Matcher> filterCall)
- Description copied from interface:
Filter
- Method isRemove returns true if input should be removed from the tuple stream.
- Specified by:
isRemove
in interface Filter<Matcher>
- Parameters:
flowProcess
- of type FlowProcessfilterCall
- of type FilterCall
- Returns:
- boolean
equals
public boolean equals(Object object)
- Overrides:
equals
in class RegexMatcher
hashCode
public int hashCode()
- Overrides:
hashCode
in class RegexMatcher
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.