cascading.operation.text
Class FieldFormatter

java.lang.Object
  extended by cascading.operation.BaseOperation<Tuple>
      extended by cascading.operation.text.FieldFormatter
All Implemented Interfaces:
Function<Tuple>, Operation<Tuple>, Serializable

public class FieldFormatter
extends BaseOperation<Tuple>
implements Function<Tuple>

Class FieldFormatter formats the values in a Tuple with a given format and stuffs the result into a new field.

This function uses the Formatter class for formatting the argument tuple values into a new string.

See Also:
Serialized Form

Field Summary
static String FIELD_NAME
          Field FIELD_NAME
 
Fields inherited from class cascading.operation.BaseOperation
fieldDeclaration, numArgs, trace
 
Fields inherited from interface cascading.operation.Operation
ANY
 
Constructor Summary
FieldFormatter(Fields fieldDeclaration, String format)
          Constructor FieldJoiner creates a new FieldJoiner instance.
FieldFormatter(String format)
          Constructor FieldJoiner creates a new FieldFormatter instance using the default field name "formatted".
 
Method Summary
 boolean equals(Object object)
           
 String getFormat()
          Method getFormat returns the format of this FieldJoiner object.
 int hashCode()
           
 void operate(FlowProcess flowProcess, FunctionCall<Tuple> functionCall)
          Method operate provides the implementation of this Function.
 void prepare(FlowProcess flowProcess, OperationCall<Tuple> operationCall)
          Method prepare does nothing, and may safely be overridden.
 
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
 

Field Detail

FIELD_NAME

public static final String FIELD_NAME
Field FIELD_NAME

See Also:
Constant Field Values
Constructor Detail

FieldFormatter

@ConstructorProperties(value="format")
public FieldFormatter(String format)
Constructor FieldJoiner creates a new FieldFormatter instance using the default field name "formatted".

Parameters:
format - of type String

FieldFormatter

@ConstructorProperties(value={"fieldDeclaration","format"})
public FieldFormatter(Fields fieldDeclaration,
                                                 String format)
Constructor FieldJoiner creates a new FieldJoiner instance.

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

getFormat

public String getFormat()
Method getFormat returns the format of this FieldJoiner object.

Returns:
the format (type String) of this FieldJoiner object.

prepare

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

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

operate

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

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

equals

public boolean equals(Object object)
Overrides:
equals in class BaseOperation<Tuple>

hashCode

public int hashCode()
Overrides:
hashCode in class BaseOperation<Tuple>


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