KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > olap > Member


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/olap/Member.java#24 $
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) 1999-2002 Kana Software, Inc.
7 // Copyright (C) 2001-2007 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 2 March, 1999
12 */

13
14 package mondrian.olap;
15
16 /**
17  * A <code>Member</code> is a 'point' on a dimension of a cube. Examples are
18  * <code>[Time].[1997].[January]</code>,
19  * <code>[Customer].[All Customers]</code>,
20  * <code>[Customer].[USA].[CA]</code>,
21  * <code>[Measures].[Unit Sales]</code>.
22  *
23  * <p> Every member belongs to a {@link Level} of a {@link Hierarchy}. Members
24  * except the root member have a parent, and members not at the leaf level
25  * have one or more children.
26  *
27  * <p> Measures are a special kind of member. They belong to their own
28  * dimension, <code>[Measures]</code>.
29  *
30  * <p> There are also special members representing the 'All' value of a
31  * hierarchy, the null value, and the error value.
32  *
33  * <p> Members can have member properties. Their {@link Level#getProperties}
34  * defines which are allowed.
35  */

36 public interface Member extends OlapElement, Comparable JavaDoc {
37
38     /**
39      * Returns this member's parent, or null (not the 'null member', as
40      * returned by {@link Hierarchy#getNullMember}) if it has no parent.
41      *
42      * <p>In an access-control context, a member may have no <em>visible</em>
43      * parents, so use {@link SchemaReader#getMemberParent}.
44      */

45     Member getParentMember();
46
47     Level getLevel();
48
49     Hierarchy getHierarchy();
50
51     /**
52      * Returns name of parent member, or empty string (not null) if we are the
53      * root.
54      */

55     String JavaDoc getParentUniqueName();
56
57     /**
58      * Returns the type of member.
59      */

60     MemberType getMemberType();
61
62     enum MemberType {
63         UNKNOWN,
64         REGULAR, // adMemberRegular
65
ALL,
66         MEASURE,
67         FORMULA,
68         /**
69          * This member is its hierarchy's NULL member (such as is returned by
70          * <code>[Gender]&#46;[All Gender]&#46;PrevMember</code>, for example).
71          */

72         NULL
73     }
74
75     /**
76      * Only allowable if the member is part of the <code>WITH</code> clause of
77      * a query.
78      */

79     void setName(String JavaDoc name);
80
81     /** Returns whether this is the 'all' member. */
82     boolean isAll();
83
84     /** Returns whether this is a member of the measures dimension. */
85     boolean isMeasure();
86
87     /** Returns whether this is the 'null member'. */
88     boolean isNull();
89
90     /**
91      * Returns whether <code>member</code> is equal to, a child, or a
92      * descendent of this <code>Member</code>.
93      */

94     boolean isChildOrEqualTo(Member member);
95
96     /** Returns whether this member is computed using either a <code>with
97      * member</code> clause in an mdx query or a calculated member defined in
98      * cube. */

99     boolean isCalculated();
100     int getSolveOrder();
101     Exp getExpression();
102
103     /**
104      * Returns array of all members, which are ancestor to <code>this</code>.
105      */

106     Member[] getAncestorMembers();
107
108     /**
109      * Returns whether this member is computed from a <code>with member</code>
110      * clause in an mdx query.
111      */

112     boolean isCalculatedInQuery();
113
114     /**
115      * Returns the value of the property named <code>propertyName</code>.
116      * Name match is case-sensitive.
117      */

118     Object JavaDoc getPropertyValue(String JavaDoc propertyName);
119
120     /**
121      * Returns the value of the property named <code>propertyName</code>,
122      * matching according to the required case-sensitivity.
123      */

124     Object JavaDoc getPropertyValue(String JavaDoc propertyName, boolean matchCase);
125
126     /**
127      * Returns the formatted value of the property named <code>propertyName</code>.
128      */

129     String JavaDoc getPropertyFormattedValue(String JavaDoc propertyName);
130
131     /**
132      * Sets a property of this member to a given value.
133      */

134     void setProperty(String JavaDoc name, Object JavaDoc value);
135
136     /**
137      * Returns the definitions of the properties this member may have.
138      */

139     Property[] getProperties();
140
141     /**
142      * Returns the ordinal of the member.
143      */

144     int getOrdinal();
145
146     /**
147      * Returns the order key of the member (relative to its siblings);
148      * null if undefined or unavailable.
149      */

150     Comparable JavaDoc getOrderKey();
151
152     /**
153      * Returns whether this member is 'hidden', as per the rules which define
154      * a ragged hierarchy.
155      */

156     boolean isHidden();
157
158     /**
159      * returns the depth of this member, which is not the level's depth
160      * in case of parent child dimensions
161      * @return depth
162      */

163     int getDepth();
164
165     /**
166      * Returns the system-generated data member that is associated with a
167      * nonleaf member of a dimension.
168      *
169      * <p>Returns this member if this member is a leaf member, or if the
170      * nonleaf member does not have an associated data member.</p>
171      */

172     Member getDataMember();
173 }
174
175 // End Member.java
176
Popular Tags