KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Category


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/Category.java#8 $
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) 2003-2006 Julian Hyde
7 // All Rights Reserved.
8 // You must accept the terms of that agreement to use this software.
9 //
10 // jhyde, Feb 21, 2003
11 */

12 package mondrian.olap;
13
14 /**
15  * <code>Category</code> enumerates the possible expression types.
16  *
17  * <p>Values of this enumeration are returned by {@link Exp#getCategory()},
18  * {@link FunDef#getParameterCategories()}, and
19  * {@link FunDef#getReturnCategory()}.
20  *
21  * <p>For modern code, the more descriptive type system
22  * ({@link mondrian.olap.type.Type}) is preferred.
23  *
24  * @author jhyde
25  * @since Feb 21, 2003
26  * @version $Id: //open/mondrian/src/main/mondrian/olap/Category.java#8 $
27  */

28 public class Category extends EnumeratedValues {
29     /** The singleton instance of <code>Category</code>. */
30     public static final Category instance = new Category();
31
32     private Category() {
33         super(
34                 new String JavaDoc[] {
35                     "unknown", "array", "dimension", "hierarchy", "level",
36                     "logical", "member", "numeric", "set",
37                     "string", "tuple", "symbol", "cube", "value", "integer", "null",
38                 },
39                 new int[] {
40                     Unknown, Array, Dimension, Hierarchy, Level,
41                     Logical, Member, Numeric, Set,
42                     String, Tuple, Symbol, Cube, Value, Integer, Null,
43                 },
44                 new String JavaDoc[] {
45                     "Unknown", "Array", "Dimension", "Hierarchy", "Level",
46                     "Logical Expression", "Member", "Numeric Expression", "Set",
47                     "String", "Tuple", "Symbol", "Cube", "Value", "Integer", "Null",
48                 }
49         );
50     }
51
52     /** Returns the singleton instance of <code>Category</code>. */
53     public static Category instance() {
54         return instance;
55     }
56
57     /** <code>Unknown</code> is an expression whose type is as yet unknown. */
58     public static final int Unknown = 0;
59     /** <code>Array</code> is an expression of array type. */
60     public static final int Array = 1;
61     /** <code>Dimension</code> is a dimension expression.
62      * @see Dimension */

63     public static final int Dimension = 2;
64     /** <code>Hierarchy</code> is a hierarchy expression.
65      * @see Hierarchy */

66     public static final int Hierarchy = 3;
67     /** <code>Level</code> is a level expression.
68      * @see Level */

69     public static final int Level = 4;
70     /** <code>Logical</code> is a boolean expression. */
71     public static final int Logical = 5;
72     /** <code>Member</code> is a member expression.
73      * @see Member */

74     public static final int Member = 6;
75     /** <code>Numeric</code> is a numeric expression. */
76     public static final int Numeric = 7;
77     /** <code>Set</code> is a set of members or tuples. */
78     public static final int Set = 8;
79     /** <code>String</code> is a string expression. */
80     public static final int String = 9;
81     /** <code>Tuple</code> is a tuple expression. */
82     public static final int Tuple = 10;
83     /** <code>Symbol</code> is a symbol, for example the <code>BASC</code>
84      * keyword to the <code>Order()</code> function. */

85     public static final int Symbol = 11;
86     /** <code>Cube</code> is a cube expression.
87      * @see Cube */

88     public static final int Cube = 12;
89     /** <code>Value</code> is any expression yielding a string or numeric value. */
90     public static final int Value = 13;
91     /** <code>Integer</code> is an integer expression. This is a subtype of
92      * {@link #Numeric}. */

93     public static final int Integer = 15;
94     /**
95      * Represents a <code>Null</code> value
96      */

97     public static final int Null = 16;
98     /**
99      * <code>Expression</code> is a flag which, when bitwise-OR-ed with a
100      * category value, indicates an expression (as opposed to a constant).
101      */

102     public static final int Expression = 0;
103     /** <code>Constant</code> is a flag which, when bitwise-OR-ed with a
104      * category value, indicates a constant (as opposed to an expression). */

105     public static final int Constant = 64;
106     /** <code>Mask</code> is a mask to remove flags. */
107     public static final int Mask = 31;
108 }
109
110 // End Category.java
111
Popular Tags