mondrian.rolap
Class DelegatingRolapMember

java.lang.Object
  extended by mondrian.olap.OlapElementBase
      extended by mondrian.olap.MemberBase
          extended by mondrian.rolap.RolapMemberBase
              extended by mondrian.rolap.DelegatingRolapMember
All Implemented Interfaces:
Comparable, Annotated, Member, OlapElement, RolapCalculation, RolapMember
Direct Known Subclasses:
RestrictedMemberReader.MultiCardinalityDefaultMember, RolapCubeMember

public class DelegatingRolapMember
extends RolapMemberBase

Implementation of RolapMember that delegates all calls to an underlying member.

Since:
Mar 16, 2010
Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.rolap.RolapMemberBase
RolapMemberBase.DefaultPropertyValueMapFactory, RolapMemberBase.PropertyValueMapFactory, RolapMemberBase.PropertyValueMapFactoryFactory
 
Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberType
 
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
 
Field Summary
protected  RolapMember member
           
 
Fields inherited from class mondrian.olap.MemberBase
flags, level, parentMember, uniqueName
 
Fields inherited from class mondrian.olap.OlapElementBase
caption, visible
 
Constructor Summary
protected DelegatingRolapMember(RolapMember member)
           
 
Method Summary
 int compareTo(Object o)
          Compares this member to another RolapMemberBase.
 List<Member> getAncestorMembers()
          Returns a list of the ancestor members of this member.
 Map<String,Annotation> getAnnotationMap()
          Returns a list of annotations.
 String getCaption()
          Returns the display name of this catalog element.
 Member getDataMember()
          Returns the system-generated data member that is associated with a nonleaf member of a dimension.
 int getDepth()
          returns the depth of this member, which is not the level's depth in case of parent child dimensions
 String getDescription()
           
 Dimension getDimension()
          Returns the dimension of a this expression, or null if no dimension is defined.
 Exp getExpression()
          Returns the expression by which this member is calculated.
 RolapHierarchy getHierarchy()
           
 Object getKey()
           
 RolapLevel getLevel()
           
 Member.MemberType getMemberType()
          Returns the type of member.
 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.
 String getParentUniqueName()
          Returns name of parent member, or empty string (not null) if we are the root.
 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.
 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.
 String getQualifiedName()
          Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".
 int getSolveOrder()
          Returns the solve order of this calculation.
 String getUniqueName()
           
 boolean isAll()
          Returns whether this is the 'all' member.
 boolean isAllMember()
           
 boolean isCalculated()
          Returns whether this member is computed using either a with member clause in an mdx query or a calculated member defined in cube.
 boolean isCalculatedInQuery()
          Returns whether this member is computed from a WITH MEMBER clause in an MDX query.
 boolean isChildOrEqualTo(Member member2)
          Returns whether member is equal to, a child, or a descendent of this Member.
 boolean isEvaluated()
          Returns whether this member should be evaluated within the Evaluator.
 boolean isHidden()
          Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy.
 boolean isMeasure()
          Returns whether this is a member of the measures dimension.
 boolean isNull()
          Returns whether this is the 'null member'.
 boolean isParentChildLeaf()
           
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)
          Looks up a child element, returning null if it does not exist.
 void setName(String name)
          Only allowable if the member is part of the WITH clause of a query.
 void setProperty(String name, Object value)
          Sets a property of this member to a given value.
 
Methods inherited from class mondrian.rolap.RolapMemberBase
childLevelHasApproxRowCount, containsAggregateFunction, equals, equals, getAllMembers, getCompiledExpression, getHierarchyCardinality, getHierarchyOrdinal, getLogger, getPropertyFromMap, hashCode, keyToString, makeUniqueName, setContextIn, setOrderKey, setOrdinal, setOrdinals, setParentMember, setUniqueName
 
Methods inherited from class mondrian.olap.MemberBase
computeCalculated, isChildOrEqualTo
 
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, getLocalized, isVisible, setCaption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.olap.OlapElement
getLocalized, isVisible
 

Field Detail

member

protected final RolapMember member
Constructor Detail

DelegatingRolapMember

protected DelegatingRolapMember(RolapMember member)
Method Detail

getLevel

public RolapLevel getLevel()
Specified by:
getLevel in interface Member
Specified by:
getLevel in interface RolapMember
Overrides:
getLevel in class RolapMemberBase

getKey

public Object getKey()
Specified by:
getKey in interface RolapMember
Overrides:
getKey in class RolapMemberBase

getParentMember

public RolapMember getParentMember()
Description copied from interface: Member
Returns this member's parent, or null (not the 'null member', as returned by 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).

Specified by:
getParentMember in interface Member
Specified by:
getParentMember in interface RolapMember
Overrides:
getParentMember in class RolapMemberBase

getHierarchy

public RolapHierarchy getHierarchy()
Specified by:
getHierarchy in interface Member
Specified by:
getHierarchy in interface OlapElement
Specified by:
getHierarchy in interface RolapMember
Overrides:
getHierarchy in class RolapMemberBase

getParentUniqueName

public String getParentUniqueName()
Description copied from interface: Member
Returns name of parent member, or empty string (not null) if we are the root.

Specified by:
getParentUniqueName in interface Member
Overrides:
getParentUniqueName in class MemberBase

getMemberType

public Member.MemberType getMemberType()
Description copied from interface: Member
Returns the type of member.

Specified by:
getMemberType in interface Member
Overrides:
getMemberType in class MemberBase

isParentChildLeaf

public boolean isParentChildLeaf()
Specified by:
isParentChildLeaf in interface Member
Overrides:
isParentChildLeaf in class RolapMemberBase

setName

public void setName(String name)
Description copied from interface: Member
Only allowable if the member is part of the WITH clause of a query.

Specified by:
setName in interface Member
Overrides:
setName in class RolapMemberBase

isAll

public boolean isAll()
Description copied from interface: Member
Returns whether this is the 'all' member.

Specified by:
isAll in interface Member
Overrides:
isAll in class MemberBase

isMeasure

public boolean isMeasure()
Description copied from interface: Member
Returns whether this is a member of the measures dimension.

Specified by:
isMeasure in interface Member
Overrides:
isMeasure in class MemberBase

isNull

public boolean isNull()
Description copied from interface: Member
Returns whether this is the 'null member'.

Specified by:
isNull in interface Member
Overrides:
isNull in class MemberBase

isChildOrEqualTo

public boolean isChildOrEqualTo(Member member2)
Description copied from interface: Member
Returns whether member is equal to, a child, or a descendent of this Member.

Specified by:
isChildOrEqualTo in interface Member
Overrides:
isChildOrEqualTo in class MemberBase

isCalculated

public boolean isCalculated()
Description copied from interface: Member
Returns whether this member is computed using either a with member clause in an mdx query or a calculated member defined in cube.

Specified by:
isCalculated in interface Member
Overrides:
isCalculated in class MemberBase

isEvaluated

public boolean isEvaluated()
Description copied from interface: Member
Returns whether this member should be evaluated within the Evaluator.

Normally Member.isCalculated() and Member.isEvaluated() should return the same value, but in situations where mondrian would like to treat the two concepts separately such in role based security, these values may differ.

Specified by:
isEvaluated in interface Member
Overrides:
isEvaluated in class MemberBase
Returns:
true if evaluated

getSolveOrder

public int getSolveOrder()
Description copied from interface: RolapCalculation
Returns the solve order of this calculation. Identifies which order calculations are expanded.

Specified by:
getSolveOrder in interface Member
Specified by:
getSolveOrder in interface RolapCalculation
Overrides:
getSolveOrder in class MemberBase
Returns:
Solve order

getExpression

public Exp getExpression()
Description copied from class: MemberBase
Returns the expression by which this member is calculated. The expression is not null if and only if the member is not calculated.

Specified by:
getExpression in interface Member
Overrides:
getExpression in class MemberBase

getAncestorMembers

public List<Member> getAncestorMembers()
Description copied from interface: Member
Returns a list of the ancestor members of this member.

Specified by:
getAncestorMembers in interface Member
Overrides:
getAncestorMembers in class MemberBase

isCalculatedInQuery

public boolean isCalculatedInQuery()
Description copied from interface: Member
Returns whether this member is computed from a WITH MEMBER clause in an MDX query.

Specified by:
isCalculatedInQuery in interface Member
Specified by:
isCalculatedInQuery in interface RolapCalculation
Overrides:
isCalculatedInQuery in class RolapMemberBase
Returns:
whether this calculation is computed in an MDX query

getPropertyValue

public Object getPropertyValue(String propertyName)
Description copied from interface: Member
Returns the value of the property named propertyName. Name match is case-sensitive.

Specified by:
getPropertyValue in interface Member
Overrides:
getPropertyValue in class RolapMemberBase

getPropertyValue

public Object getPropertyValue(String propertyName,
                               boolean matchCase)
Description copied from interface: Member
Returns the value of the property named propertyName, matching according to the required case-sensitivity.

Specified by:
getPropertyValue in interface Member
Overrides:
getPropertyValue in class RolapMemberBase

getPropertyFormattedValue

public String getPropertyFormattedValue(String propertyName)
Description copied from interface: Member
Returns the formatted value of the property named propertyName.

Specified by:
getPropertyFormattedValue in interface Member
Overrides:
getPropertyFormattedValue in class RolapMemberBase

setProperty

public void setProperty(String name,
                        Object value)
Description copied from class: RolapMemberBase
Sets a property of this member to a given value.

WARNING: Setting system properties such as "$name" may have nasty side-effects.

Specified by:
setProperty in interface Member
Overrides:
setProperty in class RolapMemberBase

getProperties

public Property[] getProperties()
Description copied from interface: Member
Returns the definitions of the properties this member may have.

Specified by:
getProperties in interface Member
Overrides:
getProperties in class RolapMemberBase

getOrdinal

public int getOrdinal()
Description copied from class: MemberBase
Returns the ordinal of this member within its hierarchy. The default implementation returns -1.

Specified by:
getOrdinal in interface Member
Overrides:
getOrdinal in class RolapMemberBase

getOrderKey

public Comparable getOrderKey()
Description copied from class: MemberBase
Returns the order key of this member among its siblings. The default implementation returns null.

Specified by:
getOrderKey in interface Member
Overrides:
getOrderKey in class RolapMemberBase

isHidden

public boolean isHidden()
Description copied from interface: Member
Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy.

Specified by:
isHidden in interface Member
Overrides:
isHidden in class RolapMemberBase

getDepth

public int getDepth()
Description copied from interface: Member
returns the depth of this member, which is not the level's depth in case of parent child dimensions

Specified by:
getDepth in interface Member
Overrides:
getDepth in class RolapMemberBase
Returns:
depth

getDataMember

public Member getDataMember()
Description copied from interface: Member
Returns the system-generated data member that is associated with a nonleaf member of a dimension.

Returns this member if this member is a leaf member, or if the nonleaf member does not have an associated data member.

Specified by:
getDataMember in interface Member
Overrides:
getDataMember in class MemberBase

compareTo

public int compareTo(Object o)
Description copied from class: RolapMemberBase
Compares this member to another RolapMemberBase.

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 RolapMemberBase.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).

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class RolapMemberBase
Returns:
-1 if this is less, 0 if this is the same, 1 if this is greater

getUniqueName

public String getUniqueName()
Specified by:
getUniqueName in interface OlapElement
Overrides:
getUniqueName in class MemberBase

getName

public String getName()
Specified by:
getName in interface OlapElement
Overrides:
getName in class RolapMemberBase

getDescription

public String getDescription()
Specified by:
getDescription in interface OlapElement
Overrides:
getDescription in class MemberBase

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment s,
                               MatchType matchType)
Description copied from interface: OlapElement
Looks up a child element, returning null if it does not exist.

Specified by:
lookupChild in interface OlapElement
Overrides:
lookupChild in class MemberBase

getAnnotationMap

public Map<String,Annotation> getAnnotationMap()
Description copied from interface: Annotated
Returns a list of annotations.

The map may be empty, never null.

Specified by:
getAnnotationMap in interface Annotated
Overrides:
getAnnotationMap in class RolapMemberBase
Returns:
Map from annotation name to annotations.

getQualifiedName

public String getQualifiedName()
Description copied from interface: OlapElement
Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".

Specified by:
getQualifiedName in interface OlapElement
Overrides:
getQualifiedName in class MemberBase

getCaption

public String getCaption()
Description copied from class: OlapElementBase
Returns the display name of this catalog element. If no caption is defined, the name is returned.

Specified by:
getCaption in interface OlapElement
Overrides:
getCaption in class MemberBase

getDimension

public Dimension getDimension()
Description copied from interface: OlapElement
Returns the dimension of a this expression, or null if no dimension is defined. Applicable only to set expressions.

Example 1:

 [Sales].children
 
has dimension [Sales].

Example 2:

 order(except([Promotion Media].[Media Type].members,
              {[Promotion Media].[Media Type].[No Media]}),
       [Measures].[Unit Sales], DESC)
 
has dimension [Promotion Media].

Example 3:

 CrossJoin([Product].[Product Department].members,
           [Gender].members)
 
has no dimension (well, actually it is [Product] x [Gender], but we can't represent that, so we return null);

Specified by:
getDimension in interface OlapElement
Overrides:
getDimension in class MemberBase

isAllMember

public boolean isAllMember()
Specified by:
isAllMember in interface RolapMember
Overrides:
isAllMember in class RolapMemberBase

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads