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-2009 Pentaho 008// All Rights Reserved. 009*/ 010package mondrian.calc.impl; 011 012import mondrian.calc.Calc; 013import mondrian.calc.StringCalc; 014import mondrian.olap.Evaluator; 015import mondrian.olap.Exp; 016 017/** 018 * Abstract implementation of the {@link mondrian.calc.StringCalc} interface. 019 * 020 * <p>The derived class must 021 * implement the {@link #evaluateString(mondrian.olap.Evaluator)} method, 022 * and the {@link #evaluate(mondrian.olap.Evaluator)} method will call it. 023 * 024 * @author jhyde 025 * @since Sep 26, 2005 026 */ 027public abstract class AbstractStringCalc 028 extends AbstractCalc 029 implements StringCalc 030{ 031 /** 032 * Creates an AbstractStringCalc. 033 * 034 * @param exp Source expression 035 * @param calcs Child compiled expressions 036 */ 037 protected AbstractStringCalc(Exp exp, Calc[] calcs) { 038 super(exp, calcs); 039 } 040 041 public Object evaluate(Evaluator evaluator) { 042 return evaluateString(evaluator); 043 } 044} 045 046// End AbstractStringCalc.java