001    /*
002    // $Id: //open/mondrian/src/main/mondrian/olap/fun/ValueFunDef.java#10 $
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) 2002-2002 Kana Software, Inc.
007    // Copyright (C) 2002-2006 Julian Hyde and others
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, Jun 14, 2002
012    */
013    
014    package mondrian.olap.fun;
015    
016    import mondrian.olap.*;
017    import mondrian.olap.type.Type;
018    
019    import java.io.PrintWriter;
020    
021    /**
022     * A <code>ValueFunDef</code> is a pseudo-function to evaluate a member or
023     * a tuple. Similar to {@link TupleFunDef}.
024     *
025     * @author jhyde
026     * @since Jun 14, 2002
027     * @version $Id: //open/mondrian/src/main/mondrian/olap/fun/ValueFunDef.java#10 $
028     */
029    class ValueFunDef extends FunDefBase {
030        private final int[] argTypes;
031    
032        ValueFunDef(int[] argTypes) {
033            super(
034                "_Value()",
035                "_Value([<Member>, ...])",
036                "Pseudo-function which evaluates a tuple.",
037                Syntax.Parentheses,
038                Category.Numeric,
039                argTypes);
040            this.argTypes = argTypes;
041        }
042    
043        public int getReturnCategory() {
044            return Category.Tuple;
045        }
046    
047        public int[] getParameterCategories() {
048            return argTypes;
049        }
050    
051        public void unparse(Exp[] args, PrintWriter pw) {
052            ExpBase.unparseList(pw, args, "(", ", ", ")");
053        }
054    
055        public Type getResultType(Validator validator, Exp[] args) {
056            return null;
057        }
058    
059    }
060    
061    // End ValueFunDef.java