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:
- Filter<Matcher>, Operation<Matcher>, 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().
- 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
public RegexFilter(String patternString)
- Constructor RegexFilter creates a new RegexFilter instance.
- Parameters:
patternString - of type String
RegexFilter
public RegexFilter(String patternString,
boolean removeMatch)
- Constructor RegexFilter creates a new RegexFilter instance.
- Parameters:
patternString - of type StringremoveMatch - of type boolean
RegexFilter
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
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
- See Also:
Filter.isRemove(cascading.flow.FlowProcess,cascading.operation.FilterCall)
Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.