class AverageAggregate extends AbstractAggregator<DoubleAverageAggregatorValue> implements Serializable {

    @Override
    public void combine(DoubleAverageAggregatorValue value, DoubleAverageAggregatorValue other) {
        double dValue = Double.isNaN(value.getValue()) ? 0 : value.getValue();
        double dOther = Double.isNaN(other.getValue()) ? 0 : other.getValue();
        value.setRowCount(value.getRowCount() + other.getRowCount());
        value.setValue(dValue + dOther);
    }

}