KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > SetBase


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/SetBase.java#17 $
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) 2001-2002 Kana Software, Inc.
7 // Copyright (C) 2001-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, 6 August, 2001
12 */

13
14 package mondrian.olap;
15
16 import mondrian.olap.type.Type;
17
18 import org.apache.log4j.Logger;
19
20 /**
21  * Skeleton implementation of {@link NamedSet} interface.
22  *
23  * @author jhyde
24  * @since 6 August, 2001
25  * @version $Id: //open/mondrian/src/main/mondrian/olap/SetBase.java#17 $
26  */

27 class SetBase extends OlapElementBase implements NamedSet {
28
29     private static final Logger LOGGER = Logger.getLogger(SetBase.class);
30
31     private String JavaDoc name;
32     private final Exp exp;
33
34     SetBase(String JavaDoc name, Exp exp) {
35         this.name = name;
36         this.exp = exp;
37     }
38
39     public Object JavaDoc clone() {
40         return new SetBase(name, (Exp) exp.clone());
41     }
42
43     protected Logger getLogger() {
44         return LOGGER;
45     }
46
47     public String JavaDoc getUniqueName() {
48         return "[" + name + "]";
49     }
50
51     public String JavaDoc getName() {
52         return name;
53     }
54
55     public String JavaDoc getQualifiedName() {
56         return null;
57     }
58
59     public String JavaDoc getDescription() {
60         return null;
61     }
62
63     public Hierarchy getHierarchy() {
64         return exp.getType().getHierarchy();
65     }
66
67     public Dimension getDimension() {
68         return getHierarchy().getDimension();
69     }
70
71     public OlapElement lookupChild(SchemaReader schemaReader, String JavaDoc s) {
72         return null;
73     }
74
75     public OlapElement lookupChild(
76         SchemaReader schemaReader, String JavaDoc s, MatchType matchType) {
77         return null;
78     }
79
80     public void setName(String JavaDoc name) {
81         this.name = name;
82     }
83
84     public Exp getExp() {
85         return exp;
86     }
87
88     public NamedSet validate(Validator validator) {
89         Exp exp2 = validator.validate(exp, false);
90         return new SetBase(name, exp2);
91     }
92
93     public Type getType() {
94         return exp.getType();
95     }
96 }
97
98 // End SetBase.java
99
Popular Tags