# The Java Embedded Aggregator Class Prd Aggregate

PrdAggregate implements the product aggregation.

### For an overview see page Java Aggregator Class

### Class Definition

        public static class PrdAggregate implements Aggregate<Number>
        {
            public void initialize(Number val)
            {
                prd = val.doubleValue();
            }

            public void accumulate(Number val)
            {
                prd *= val.doubleValue();
            }

            public Object result()
            {
                return new Double(prd);
            }

            public void merge(Aggregate<Number> other)
            {
                prd *= ((PrdAggregate)other).prd;
            }

            double prd;
        }