KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > fun > ValueFunDef


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/fun/ValueFunDef.java#10 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2002-2002 Kana Software, Inc.
7 // Copyright (C) 2002-2006 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, Jun 14, 2002
12 */

13
14 package mondrian.olap.fun;
15
16 import mondrian.olap.*;
17 import mondrian.olap.type.Type;
18
19 import java.io.PrintWriter JavaDoc;
20
21 /**
22  * A <code>ValueFunDef</code> is a pseudo-function to evaluate a member or
23  * a tuple. Similar to {@link TupleFunDef}.
24  *
25  * @author jhyde
26  * @since Jun 14, 2002
27  * @version $Id: //open/mondrian/src/main/mondrian/olap/fun/ValueFunDef.java#10 $
28  */

29 class ValueFunDef extends FunDefBase {
30     private final int[] argTypes;
31
32     ValueFunDef(int[] argTypes) {
33         super(
34             "_Value()",
35             "_Value([<Member>, ...])",
36             "Pseudo-function which evaluates a tuple.",
37             Syntax.Parentheses,
38             Category.Numeric,
39             argTypes);
40         this.argTypes = argTypes;
41     }
42
43     public int getReturnCategory() {
44         return Category.Tuple;
45     }
46
47     public int[] getParameterCategories() {
48         return argTypes;
49     }
50
51     public void unparse(Exp[] args, PrintWriter JavaDoc pw) {
52         ExpBase.unparseList(pw, args, "(", ", ", ")");
53     }
54
55     public Type getResultType(Validator validator, Exp[] args) {
56         return null;
57     }
58
59 }
60
61 // End ValueFunDef.java
62
Popular Tags