KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Parameter


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

10 package mondrian.olap;
11
12 import mondrian.olap.type.Type;
13
14 /**
15  * Parameter to a Query.
16  *
17  * <p>A parameter is not an expression; see {@link mondrian.mdx.ParameterExpr}.
18  *
19  * @author jhyde
20  * @version $Id: //open/mondrian/src/main/mondrian/olap/Parameter.java#25 $
21  * @since Jul 22, 2006
22  */

23 public interface Parameter {
24     /**
25      * Returns the scope where this parmater is defined.
26      */

27     Scope getScope();
28
29     /**
30      * Returns the type of this Parameter.
31      */

32     Type getType();
33
34     /**
35      * Returns the expression which provides the default value for this
36      * Parameter. Never null.
37      */

38     Exp getDefaultExp();
39
40     /**
41      * Returns the name of this Parameter.
42      */

43     String JavaDoc getName();
44
45     /**
46      * Returns the description of this Parameter.
47      */

48     String JavaDoc getDescription();
49
50     /**
51      * Returns whether the value of this Parameter can be modified in a query.
52      */

53     boolean isModifiable();
54
55     /**
56      * Returns the value of this parameter. If {@link #setValue(Object)} has
57      * not been called, and the parameter still has its default value, returns
58      * null.
59      *
60      * <p>The type of the value is (depending on the type of the parameter)
61      * a {@link String}, {@link Number}, or {@link Member}.
62      */

63     Object JavaDoc getValue();
64
65     /**
66      * Sets the value of this parameter.
67      *
68      * @param value Value of the parameter; must be a {@link String},
69      * a {@link Double}, or a {@link mondrian.olap.Member}
70      */

71     void setValue(Object JavaDoc value);
72
73     /**
74      * Scope where a parameter is defined.
75      */

76     enum Scope {
77         System,
78         Schema,
79         Connection,
80         Statement
81     }
82 }
83
84 // End Parameter.java
85
Popular Tags