001    /*
002    // $Id: //open/mondrian/src/main/mondrian/olap/Aggregator.java#5 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2003-2006 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package mondrian.olap;
011    
012    import mondrian.calc.Calc;
013    
014    import java.util.List;
015    
016    /**
017     * Describes an aggregation operator, such as "sum" or "count".
018     *
019     * @see FunDef
020     * @see Evaluator
021     *
022     * @author jhyde$
023     * @since Jul 9, 2003$
024     * @version $Id: //open/mondrian/src/main/mondrian/olap/Aggregator.java#5 $
025     */
026    public interface Aggregator {
027        /**
028         * Returns the aggregator used to combine sub-totals into a grand-total.
029         */
030        Aggregator getRollup();
031    
032        /**
033         * Applies this aggregator to an expression over a set of members and
034         * returns the result.
035         *
036         * @param evaluator Evaluation context
037         * @param members List of members, not null
038         * @param calc Expression to evaluate
039         */
040        Object aggregate(Evaluator evaluator, List members, Calc calc);
041    }
042    
043    // End Aggregator.java