001    /*
002    // $Id: //open/mondrian/src/main/mondrian/calc/impl/ValueCalc.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.*;
013    import mondrian.calc.Calc;
014    
015    /**
016     * Expression which yields the value of the current member in the current
017     * dimensional context.
018     *
019     * @see mondrian.calc.impl.MemberValueCalc
020     *
021     * @author jhyde
022     * @version $Id: //open/mondrian/src/main/mondrian/calc/impl/ValueCalc.java#2 $
023     * @since Sep 27, 2005
024     */
025    public class ValueCalc extends GenericCalc {
026        public ValueCalc(Exp exp) {
027            super(exp);
028        }
029    
030        public Object evaluate(Evaluator evaluator) {
031            return evaluator.evaluateCurrent();
032        }
033    
034        public Calc[] getCalcs() {
035            return new Calc[0];
036        }
037    
038        public boolean dependsOn(Dimension dimension) {
039            return true;
040        }
041    }
042    
043    // End ValueCalc.java