001/* 002// This software is subject to the terms of the Eclipse Public License v1.0 003// Agreement, available at the following URL: 004// http://www.eclipse.org/legal/epl-v10.html. 005// You must accept the terms of that agreement to use this software. 006// 007// Copyright (C) 2006-2006 Pentaho 008// All Rights Reserved. 009*/ 010package mondrian.calc.impl; 011 012import mondrian.calc.Calc; 013import mondrian.calc.VoidCalc; 014import mondrian.olap.Evaluator; 015import mondrian.olap.Exp; 016 017/** 018 * Abstract implementation of the {@link mondrian.calc.VoidCalc} interface. 019 * 020 * <p>The derived class must 021 * implement the {@link #evaluateVoid(mondrian.olap.Evaluator)} method, 022 * and the {@link #evaluate(mondrian.olap.Evaluator)} method will call it 023 * and return <code>null</code>. 024 * 025 * @author jhyde 026 * @since Sep 29, 2005 027 */ 028public 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