cascading.operation.regex
Class RegexParser

java.lang.Object
  extended by cascading.operation.BaseOperation<C>
      extended by cascading.operation.regex.RegexOperation<Matcher>
          extended by cascading.operation.regex.RegexParser
All Implemented Interfaces:
Function<Matcher>, Operation<Matcher>, Serializable

public class RegexParser
extends RegexOperation<Matcher>
implements Function<Matcher>

Class RegexParser is used to extract a matched regex from an incoming argument value.

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
RegexParser(Fields fieldDeclaration, String patternString)
          Constructor RegexParser creates a new RegexParser instance, where the patternString is a simple regular expression whose match value is stored in the new field named by the given fieldDeclaration.
RegexParser(Fields fieldDeclaration, String patternString, int[] groups)
          Constructor RegexParser creates a new RegexParser instance, where the patternString is a regular expression with match groups and whose groups designated by groupPos are stored in the named fieldDeclarations.
RegexParser(String patternString)
          Constructor RegexParser creates a new RegexParser instance, where the argument Tuple value is matched and returned in a new field.
RegexParser(String patternString, int[] groups)
          Constructor RegexParser creates a new RegexParser instance, where the patternString is a regular expression with match groups and whose groups designated by groupPos are stored in the appropriate number of new fields.
 
Method Summary
 void operate(FlowProcess flowProcess, FunctionCall<Matcher> functionCall)
          Method operate provides the implementation of this Function.
 void prepare(FlowProcess flowProcess, OperationCall<Matcher> operationCall)
          Method prepare does nothing, and may safely be overridden.
 
Methods inherited from class cascading.operation.regex.RegexOperation
getPattern
 
Methods inherited from class cascading.operation.BaseOperation
cleanup, getFieldDeclaration, getNumArgs, getTrace, printOperationInternal, toString, toStringInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cascading.operation.Operation
cleanup, getFieldDeclaration, getNumArgs
 

Constructor Detail

RegexParser

public RegexParser(String patternString)
Constructor RegexParser creates a new RegexParser instance, where the argument Tuple value is matched and returned in a new field.

Parameters:
patternString - of type String

RegexParser

public RegexParser(Fields fieldDeclaration,
                   String patternString)
Constructor RegexParser creates a new RegexParser instance, where the patternString is a simple regular expression whose match value is stored in the new field named by the given fieldDeclaration.

If the fieldDeclaration declares more tha one field, it will be assumed the pattrnString defines the same number of sub-groups. Subsequently each sub-group will be returned in its corresponding field.

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

RegexParser

public RegexParser(String patternString,
                   int[] groups)
Constructor RegexParser creates a new RegexParser instance, where the patternString is a regular expression with match groups and whose groups designated by groupPos are stored in the appropriate number of new fields.

Parameters:
patternString - of type String
groups - of type int[]

RegexParser

public RegexParser(Fields fieldDeclaration,
                   String patternString,
                   int[] groups)
Constructor RegexParser creates a new RegexParser instance, where the patternString is a regular expression with match groups and whose groups designated by groupPos are stored in the named fieldDeclarations.

Parameters:
fieldDeclaration - of type Fields
patternString - of type String
groups - of type int[]
Method Detail

prepare

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

Specified by:
prepare in interface Operation<Matcher>
Overrides:
prepare in class BaseOperation<Matcher>

operate

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

Specified by:
operate in interface Function<Matcher>
Parameters:
flowProcess - of type FlowProcess
functionCall - of type FunctionCall
See Also:
Function.operate(cascading.flow.FlowProcess,cascading.operation.FunctionCall)


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