001    /*
002    // $Id: //open/mondrian/src/main/mondrian/calc/impl/AbstractVoidCalc.java#2 $
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) 2006-2006 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package mondrian.calc.impl;
011    
012    import mondrian.olap.Evaluator;
013    import mondrian.olap.Exp;
014    import mondrian.calc.*;
015    
016    /**
017     * Abstract implementation of the {@link mondrian.calc.VoidCalc} interface.
018     *
019     * <p>The derived class must
020     * implement the {@link #evaluateVoid(mondrian.olap.Evaluator)} method,
021     * and the {@link #evaluate(mondrian.olap.Evaluator)} method will call it
022     * and return <code>null</code>.
023     *
024     * @author jhyde
025     * @version $Id: //open/mondrian/src/main/mondrian/calc/impl/AbstractVoidCalc.java#2 $
026     * @since Sep 29, 2005
027     */
028    public class AbstractVoidCalc extends GenericCalc implements VoidCalc {
029        private final Calc[] calcs;
030    
031        protected AbstractVoidCalc(Exp exp, Calc[] calcs) {
032            super(exp);
033            this.calcs = calcs;
034        }
035    
036        public Object evaluate(Evaluator evaluator) {
037            evaluateVoid(evaluator);
038            return null;
039        }
040    
041        public Calc[] getCalcs() {
042            return calcs;
043        }
044    }
045    
046    // End AbstractVoidCalc.java