org.apache.hadoop.mapred.lib.aggregate
Class DoubleValueSum

java.lang.Object
  extended by org.apache.hadoop.mapred.lib.aggregate.DoubleValueSum
All Implemented Interfaces:
ValueAggregator

public class DoubleValueSum
extends Object
implements ValueAggregator

This class implements a value aggregator that sums up a sequence of double values.


Constructor Summary
DoubleValueSum()
          The default constructor
 
Method Summary
 void addNextValue(double val)
          add a value to the aggregator
 void addNextValue(Object val)
          add a value to the aggregator
 ArrayList<String> getCombinerOutput()
           
 String getReport()
           
 double getSum()
           
 void reset()
          reset the aggregator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleValueSum

public DoubleValueSum()
The default constructor

Method Detail

addNextValue

public void addNextValue(Object val)
add a value to the aggregator

Specified by:
addNextValue in interface ValueAggregator
Parameters:
val - an object whose string representation represents a double value.

addNextValue

public void addNextValue(double val)
add a value to the aggregator

Parameters:
val - a double value.

getReport

public String getReport()
Specified by:
getReport in interface ValueAggregator
Returns:
the string representation of the aggregated value

getSum

public double getSum()
Returns:
the aggregated value

reset

public void reset()
reset the aggregator

Specified by:
reset in interface ValueAggregator

getCombinerOutput

public ArrayList<String> getCombinerOutput()
Specified by:
getCombinerOutput in interface ValueAggregator
Returns:
return an array of one element. The element is a string representation of the aggregated value. The return value is expected to be used by the a combiner.


Copyright © 2009 The Apache Software Foundation