cascading.operation.regex
Class RegexSplitGenerator

java.lang.Object
  extended by cascading.operation.BaseOperation<C>
      extended by cascading.operation.regex.RegexOperation<Pair<Pattern,Tuple>>
          extended by cascading.operation.regex.RegexSplitGenerator
All Implemented Interfaces:
DeclaresResults, Function<Pair<Pattern,Tuple>>, Operation<Pair<Pattern,Tuple>>, Traceable, Serializable

public class RegexSplitGenerator
extends RegexOperation<Pair<Pattern,Tuple>>
implements Function<Pair<Pattern,Tuple>>

Class RegexGenerator will emit a new Tuple for every split on the incoming argument value delimited by the given patternString.

RegexGenerator only expects one field value. If more than one argument value is passed, only the first is handled, the remainder are ignored.

This could be used to break a document into single word tuples for later processing for a word count.

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 if type information is provided. See the CoercibleType interface to control how custom Object types are converted to String values.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class cascading.operation.regex.RegexOperation
patternString
 
Fields inherited from class cascading.operation.BaseOperation
fieldDeclaration, numArgs, trace
 
Fields inherited from interface cascading.operation.Operation
ANY
 
Constructor Summary
RegexSplitGenerator(Fields fieldDeclaration, String patternString)
          Constructor RegexGenerator creates a new RegexGenerator instance.
RegexSplitGenerator(String patternString)
          Constructor RegexGenerator creates a new RegexGenerator instance.
 
Method Summary
 void operate(FlowProcess flowProcess, FunctionCall<Pair<Pattern,Tuple>> functionCall)
          Method operate provides the implementation of this Function.
 void prepare(FlowProcess flowProcess, OperationCall<Pair<Pattern,Tuple>> operationCall)
          Method prepare does nothing, and may safely be overridden.
 
Methods inherited from class cascading.operation.regex.RegexOperation
equals, getPattern, getPatternString, hashCode
 
Methods inherited from class cascading.operation.BaseOperation
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cascading.operation.Operation
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
 

Constructor Detail

RegexSplitGenerator

@ConstructorProperties(value="patternString")
public RegexSplitGenerator(String patternString)
Constructor RegexGenerator creates a new RegexGenerator instance.

Parameters:
patternString - of type String

RegexSplitGenerator

@ConstructorProperties(value={"fieldDeclaration","patternString"})
public RegexSplitGenerator(Fields fieldDeclaration,
                                                      String patternString)
Constructor RegexGenerator creates a new RegexGenerator instance.

Parameters:
fieldDeclaration - of type Fields
patternString - of type String
Method Detail

prepare

public void prepare(FlowProcess flowProcess,
                    OperationCall<Pair<Pattern,Tuple>> operationCall)
Description copied from class: BaseOperation
Method prepare does nothing, and may safely be overridden.

Specified by:
prepare in interface Operation<Pair<Pattern,Tuple>>
Overrides:
prepare in class BaseOperation<Pair<Pattern,Tuple>>

operate

public void operate(FlowProcess flowProcess,
                    FunctionCall<Pair<Pattern,Tuple>> functionCall)
Description copied from interface: Function
Method operate provides the implementation of this Function.

Specified by:
operate in interface Function<Pair<Pattern,Tuple>>
Parameters:
flowProcess - of type FlowProcess
functionCall - of type FunctionCall


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.