EMMA Coverage Report (generated Sun Mar 01 22:06:14 CET 2015)
[all classes][org.h2.expression]

COVERAGE SUMMARY FOR SOURCE FILE [AggregateData.java]

nameclass, %method, %block, %line, %
AggregateData.java100% (1/1)100% (2/2)90%  (38/42)92%  (11/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AggregateData100% (1/1)100% (2/2)90%  (38/42)92%  (11/12)
create (int): AggregateData 100% (1/1)90%  (35/39)91%  (10/11)
AggregateData (): void 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (http://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6package org.h2.expression;
7 
8import org.h2.engine.Database;
9import org.h2.value.Value;
10 
11/**
12 * Abstract class for the computation of an aggregate.
13 */
14abstract class AggregateData {
15 
16    /**
17     * Create an AggregateData object of the correct sub-type.
18     *
19     * @param aggregateType the type of the aggregate operation
20     * @return the aggregate data object of the specified type
21     */
22    static AggregateData create(int aggregateType) {
23        if (aggregateType == Aggregate.SELECTIVITY) {
24            return new AggregateDataSelectivity();
25        } else if (aggregateType == Aggregate.GROUP_CONCAT) {
26            return new AggregateDataGroupConcat();
27        } else if (aggregateType == Aggregate.COUNT_ALL) {
28            return new AggregateDataCountAll();
29        } else if (aggregateType == Aggregate.COUNT) {
30            return new AggregateDataCount();
31        } else if (aggregateType == Aggregate.HISTOGRAM) {
32            return new AggregateDataHistogram();
33        } else {
34            return new AggregateDataDefault(aggregateType);
35        }
36    }
37 
38    /**
39     * Add a value to this aggregate.
40     *
41     * @param database the database
42     * @param dataType the datatype of the computed result
43     * @param distinct if the calculation should be distinct
44     * @param v the value
45     */
46    abstract void add(Database database, int dataType, boolean distinct, Value v);
47 
48    /**
49     * Get the aggregate result.
50     *
51     * @param database the database
52     * @param dataType the datatype of the computed result
53     * @param distinct if distinct is used
54     * @return the value
55     */
56    abstract Value getValue(Database database, int dataType, boolean distinct);
57}

[all classes][org.h2.expression]
EMMA 2.0.5312 (C) Vladimir Roubtsov