Package com.inadco.hbl.api

Examples of com.inadco.hbl.api.AggregateFunction


                               Aggregation.Builder accumulator,
                               Aggregation source,
                               SliceOperation operation) {

        for (String funcName : funcNames) {
            AggregateFunction func = functions.get(funcName);
            if (func == null)
                throw new UnsupportedOperationException(String.format("Unsupported aggregate function:\"%s\".",
                                                                      funcName));
            func.merge(accumulator, source, operation);
        }

    }
View Full Code Here


    public Object getAggregate(String measure, String functionName) throws HblException {
        try {
            Integer index = measureName2IndexMap.get(measure);
            if (index == null)
                throw new HblException(String.format("Invalid measure name:%s.", measure));
            AggregateFunction af = afr.findFunction(functionName);
            if (af == null)
                throw new HblException(String.format("Invalid function name:%s.", functionName));
            if (result == null)
                throw new HblException("no current result");
            Aggregation measureAggr = result[index];
            if (measureAggr == null) {
                Aggregation.Builder b = delegate.current().getMeasures()[index];
                result[index] = b == null ? null : (measureAggr = b.build()); // cache
            }

            return af.getAggrValue(measureAggr);
        } catch (IOException exc) {
            throw new HblException(exc.getMessage(), exc);
        }

    }
View Full Code Here

TOP

Related Classes of com.inadco.hbl.api.AggregateFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.