cascading.operation.aggregator
Class MaxValue

java.lang.Object
  extended by cascading.operation.BaseOperation<ExtremaValueBase.Context>
      extended by cascading.operation.aggregator.ExtremaValueBase
          extended by cascading.operation.aggregator.MaxValue
All Implemented Interfaces:
DeclaresResults, Aggregator<ExtremaValueBase.Context>, Operation<ExtremaValueBase.Context>, Traceable, Serializable

public class MaxValue
extends ExtremaValueBase

Class MaxValue is an Aggregator that returns the maximum value encountered in the current group.

As opposed to the Max class, values are expected to be Comparable types vs numeric representations and the Comparable.compareTo(Object) result is use for max comparison.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cascading.operation.aggregator.ExtremaValueBase
ExtremaValueBase.Context
 
Field Summary
static String FIELD_NAME
          Field FIELD_NAME
 
Fields inherited from class cascading.operation.aggregator.ExtremaValueBase
ignoreValues
 
Fields inherited from class cascading.operation.BaseOperation
fieldDeclaration, numArgs, trace
 
Fields inherited from interface cascading.operation.Operation
ANY
 
Constructor Summary
MaxValue()
          Constructs a new instance that returns the maximum value encountered in the field name "max".
MaxValue(Fields fieldDeclaration)
          Constructs a new instance that returns the maximum value encountered in the given fieldDeclaration field name.
MaxValue(Fields fieldDeclaration, Object... ignoreValues)
          Constructs a new instance that returns the maximum value encountered in the given fieldDeclaration field name.
 
Method Summary
protected  boolean compare(Comparable lhs, Comparable rhs)
          Allows subclasses to provide own comparison method.
 
Methods inherited from class cascading.operation.aggregator.ExtremaValueBase
aggregate, complete, equals, getIgnoreValues, getResult, hashCode, prepare, start
 
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

MaxValue

public MaxValue()
Constructs a new instance that returns the maximum value encountered in the field name "max".


MaxValue

@ConstructorProperties(value="fieldDeclaration")
public MaxValue(Fields fieldDeclaration)
Constructs a new instance that returns the maximum value encountered in the given fieldDeclaration field name.

Parameters:
fieldDeclaration - of type Fields

MaxValue

@ConstructorProperties(value={"fieldDeclaration","ignoreValues"})
public MaxValue(Fields fieldDeclaration,
                                           Object... ignoreValues)
Constructs a new instance that returns the maximum value encountered in the given fieldDeclaration field name. Any argument matching an ignoredValue won't be compared.

Parameters:
fieldDeclaration - of type Fields
ignoreValues - of type Object...
Method Detail

compare

protected boolean compare(Comparable lhs,
                          Comparable rhs)
Description copied from class: ExtremaValueBase
Allows subclasses to provide own comparison method.

Specified by:
compare in class ExtremaValueBase
Parameters:
lhs - Comparable type
rhs - Comparable type
Returns:
true if the rhs should be retained as the result value


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