|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.olap.OlapElementBase mondrian.olap.MemberBase mondrian.rolap.RolapMember
public class RolapMember
A RolapMember
is a member of a RolapHierarchy
. There are
sub-classes for RolapStoredMeasure
, RolapCalculatedMember
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface mondrian.olap.Member |
---|
Member.MemberType |
Field Summary |
---|
Fields inherited from class mondrian.olap.MemberBase |
---|
flags, level, parentMember, parentUniqueName, uniqueName |
Fields inherited from class mondrian.olap.OlapElementBase |
---|
caption |
Constructor Summary | |
---|---|
protected |
RolapMember()
Used by RolapCubeMember. |
(package private) |
RolapMember(RolapMember parentMember,
RolapLevel level,
Object value)
|
protected |
RolapMember(RolapMember parentMember,
RolapLevel level,
Object key,
String name,
Member.MemberType memberType)
Creates a RolapMember |
Method Summary | |
---|---|
protected boolean |
childLevelHasApproxRowCount()
|
int |
compareTo(Object o)
Compares this member to another RolapMember . |
boolean |
equals(Object o)
|
boolean |
equals(OlapElement o)
|
static List<List<Member>> |
getAllMembers(SchemaReader schemaReader,
Hierarchy hierarchy)
This returns an array of member arrays where the first member array are the root members while the last member array are the leaf members. |
int |
getDepth()
returns the depth of this member, which is not the level's depth in case of parent child dimensions |
RolapHierarchy |
getHierarchy()
|
static int |
getHierarchyCardinality(SchemaReader schemaReader,
Hierarchy hierarchy)
|
Object |
getKey()
|
RolapLevel |
getLevel()
|
protected org.apache.log4j.Logger |
getLogger()
|
String |
getName()
|
Comparable |
getOrderKey()
Returns the order key of this member among its siblings. |
int |
getOrdinal()
Returns the ordinal of this member within its hierarchy. |
RolapMember |
getParentMember()
Returns this member's parent, or null (not the 'null member', as returned by Hierarchy.getNullMember() ) if it has no parent. |
Property[] |
getProperties()
Returns the definitions of the properties this member may have. |
String |
getPropertyFormattedValue(String propertyName)
Returns the formatted value of the property named propertyName . |
protected Object |
getPropertyFromMap(String propertyName,
boolean matchCase)
Returns the value of a property by looking it up in the property map. |
Object |
getPropertyValue(String propertyName)
Returns the value of the property named propertyName . |
Object |
getPropertyValue(String propertyName,
boolean matchCase)
Returns the value of the property named propertyName ,
matching according to the required case-sensitivity. |
int |
hashCode()
|
protected boolean |
isAllMember()
|
boolean |
isCalculatedInQuery()
Returns whether this member is computed from a WITH MEMBER
clause in an MDX query. |
boolean |
isHidden()
Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy. |
protected static String |
keyToString(Object key)
Converts a key to a string to be used as part of the member's name and unique name. |
(package private) void |
makeUniqueName(HierarchyUsage hierarchyUsage)
|
void |
setName(String name)
Only allowable if the member is part of the WITH clause of
a query. |
(package private) void |
setOrderKey(Comparable orderKey)
|
(package private) void |
setOrdinal(int ordinal)
|
static void |
setOrdinals(SchemaReader schemaReader,
Member seedMember)
Sets member ordinal values using a Bottom-up/Top-down algorithm. |
(package private) void |
setParentMember(RolapMember parentMember)
Sets a member's parent. |
void |
setProperty(String name,
Object value)
Sets a property of this member to a given value. |
protected void |
setUniqueName(Object key)
|
Methods inherited from class mondrian.olap.MemberBase |
---|
computeCalculated, getAncestorMembers, getCaption, getDataMember, getDescription, getDimension, getExpression, getMemberType, getParentUniqueName, getQualifiedName, getSolveOrder, getUniqueName, isAll, isCalculated, isChildOrEqualTo, isChildOrEqualTo, isMeasure, isNull, lookupChild, lookupChild |
Methods inherited from class mondrian.olap.OlapElementBase |
---|
clone, computeHashCode, setCaption, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RolapMember(RolapMember parentMember, RolapLevel level, Object key, String name, Member.MemberType memberType)
parentMember
- Parent memberlevel
- Level this member belongs tokey
- Key to this member in the underlying RDBMSname
- Name of this membermemberType
- Type of memberRolapMember(RolapMember parentMember, RolapLevel level, Object value)
protected RolapMember()
Method Detail |
---|
public static List<List<Member>> getAllMembers(SchemaReader schemaReader, Hierarchy hierarchy)
If you know that you will need to get all or most of the members of a hierarchy, then calling this which gets all of the hierarchy's members all at once is much faster than getting members one at a time.
schemaReader
- Schema readerhierarchy
- Hierarchy
public static int getHierarchyCardinality(SchemaReader schemaReader, Hierarchy hierarchy)
public static void setOrdinals(SchemaReader schemaReader, Member seedMember)
Gets an array of members for each level and traverses array for the lowest level, setting each member's parent's parent's etc. member's ordinal if not set working back down to the leaf member and then going to the next leaf member and traversing up again.
The above algorithm only works for a hierarchy that has all of its leaf members in the same level (that is, a non-ragged hierarchy), which is the norm. After all member ordinal values have been set, traverses the array of members, making sure that all members' ordinals have been set. If one is found that is not set, then one must to a full Top-down setting of the ordinals.
The Bottom-up/Top-down algorithm is MUCH faster than the Top-down algorithm.
schemaReader
- Schema readerseedMember
- Membervoid setParentMember(RolapMember parentMember)
Can screw up the caching structure. Only to be called by
CacheControl.createMoveCommand(mondrian.olap.Member, mondrian.olap.Member)
.
New parent must be in same level as old parent.
parentMember
- New parent membergetParentMember()
,
MemberBase.getParentUniqueName()
protected static String keyToString(Object key)
Usually, it just calls Object.toString()
. But if the key is an
integer value represented in a floating-point column, we'd prefer the
integer value. For example, one member of the
[Sales].[Store SQFT]
dimension comes out "20319.0" but we'd
like it to be "20319".
protected org.apache.log4j.Logger getLogger()
getLogger
in class OlapElementBase
public RolapLevel getLevel()
getLevel
in interface Member
getLevel
in class MemberBase
public RolapHierarchy getHierarchy()
getHierarchy
in interface Member
getHierarchy
in interface OlapElement
getHierarchy
in class MemberBase
public RolapMember getParentMember()
Member
Hierarchy.getNullMember()
) if it has no parent.
In an access-control context, a member may have no visible
parents, so use SchemaReader.getMemberParent(mondrian.olap.Member)
.
getParentMember
in interface Member
getParentMember
in class MemberBase
public int hashCode()
hashCode
in class OlapElementBase
public boolean equals(Object o)
equals
in class OlapElementBase
public boolean equals(OlapElement o)
equals
in class OlapElementBase
void makeUniqueName(HierarchyUsage hierarchyUsage)
protected void setUniqueName(Object key)
public boolean isCalculatedInQuery()
Member
WITH MEMBER
clause in an MDX query.
public String getName()
getName
in interface OlapElement
getName
in class MemberBase
public void setName(String name)
Member
WITH
clause of
a query.
public void setProperty(String name, Object value)
WARNING: Setting system properties such as "$name" may have nasty side-effects.
public final Object getPropertyValue(String propertyName)
Member
propertyName
.
Name match is case-sensitive.
public Object getPropertyValue(String propertyName, boolean matchCase)
Member
propertyName
,
matching according to the required case-sensitivity.
protected Object getPropertyFromMap(String propertyName, boolean matchCase)
propertyName
- Name of propertymatchCase
- Whether to match name case-sensitive
protected boolean childLevelHasApproxRowCount()
protected boolean isAllMember()
public Property[] getProperties()
Member
public int getOrdinal()
MemberBase
getOrdinal
in interface Member
getOrdinal
in class MemberBase
public Comparable getOrderKey()
MemberBase
getOrderKey
in interface Member
getOrderKey
in class MemberBase
void setOrdinal(int ordinal)
void setOrderKey(Comparable orderKey)
public Object getKey()
public int compareTo(Object o)
RolapMember
.
The method first compares on keys; null keys always collate last. If the keys are equal, it compares using unique name.
This method does not consider ordinal
field, because
ordinal is only unique within a parent. If you want to compare
members which may be at any position in the hierarchy, use
FunUtil.compareHierarchically(mondrian.olap.Member, mondrian.olap.Member, boolean)
.
public boolean isHidden()
Member
isHidden
in interface Member
isHidden
in class MemberBase
public int getDepth()
Member
public String getPropertyFormattedValue(String propertyName)
Member
propertyName
.
getPropertyFormattedValue
in interface Member
getPropertyFormattedValue
in class MemberBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |