mondrian.rolap
Class RolapCubeMember

java.lang.Object
  extended by mondrian.rolap.DelegatingRolapMember
      extended by mondrian.rolap.RolapCubeMember
All Implemented Interfaces:
Comparable, Annotated, Member, OlapElement, RolapMember, RolapMemberInCube
Direct Known Subclasses:
RolapAllCubeMember, RolapHierarchy.LimitedRollupMember

public class RolapCubeMember
extends DelegatingRolapMember
implements RolapMemberInCube

RolapCubeMember wraps RolapMembers and binds them to a specific cube. RolapCubeMember wraps or overrides RolapMember methods that directly reference the wrapped Member. Methods that only contain calls to other methods do not need wrapped.

Author:
Will Gorman (wgorman@pentaho.org)
 

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberType
 
Field Summary
protected  RolapCubeLevel cubeLevel
           
protected  RolapCubeMember parentCubeMember
           
 
Fields inherited from class mondrian.rolap.DelegatingRolapMember
member
 
Constructor Summary
RolapCubeMember(RolapCubeMember parent, RolapMember member, RolapCubeLevel cubeLevel)
          Creates a RolapCubeMember.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 boolean equals(OlapElement o)
           
 RolapCube getCube()
          Returns the cube this cube member belongs to.
 RolapCubeMember getDataMember()
          Returns the system-generated data member that is associated with a nonleaf member of a dimension.
 RolapCubeDimension getDimension()
          Returns the dimension of a this expression, or null if no dimension is defined.
 Exp getExpression()
           
 RolapCubeHierarchy getHierarchy()
           
 RolapCubeLevel getLevel()
          
 RolapCubeMember getParentMember()
          Returns this member's parent, or null (not the 'null member', as returned by Hierarchy.getNullMember()) if it has no parent.
 Object getPropertyValue(String propertyName, boolean matchCase)
          Returns the value of the property named propertyName, matching according to the required case-sensitivity.
 RolapMember getRolapMember()
          Returns the underlying member.
 String getUniqueName()
           
 int hashCode()
           
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment childName, MatchType matchType)
          Looks up a child element, returning null if it does not exist.
 void setProperty(String name, Object value)
          Sets a property of this member to a given value.
 String toString()
           
 
Methods inherited from class mondrian.rolap.DelegatingRolapMember
getAncestorMembers, getAnnotationMap, getCaption, getDepth, getDescription, getKey, getMemberType, getName, getOrderKey, getOrdinal, getParentUniqueName, getProperties, getPropertyFormattedValue, getPropertyValue, getQualifiedName, getSolveOrder, isAll, isAllMember, isCalculated, isCalculatedInQuery, isChildOrEqualTo, isEvaluated, isHidden, isMeasure, isNull, isParentChildLeaf, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.rolap.RolapMember
getKey, isAllMember
 
Methods inherited from interface mondrian.olap.Member
getAncestorMembers, getDepth, getMemberType, getOrderKey, getOrdinal, getParentUniqueName, getProperties, getPropertyFormattedValue, getPropertyValue, getSolveOrder, isAll, isCalculated, isCalculatedInQuery, isChildOrEqualTo, isEvaluated, isHidden, isMeasure, isNull, isParentChildLeaf, setName
 
Methods inherited from interface mondrian.olap.OlapElement
getCaption, getDescription, getName, getQualifiedName
 
Methods inherited from interface mondrian.olap.Annotated
getAnnotationMap
 

Field Detail

cubeLevel

protected final RolapCubeLevel cubeLevel

parentCubeMember

protected final RolapCubeMember parentCubeMember
Constructor Detail

RolapCubeMember

public RolapCubeMember(RolapCubeMember parent,
                       RolapMember member,
                       RolapCubeLevel cubeLevel)
Creates a RolapCubeMember.

Parameters:
parent - Parent member
member - Member of underlying (non-cube) hierarchy
cubeLevel - Level
Method Detail

getUniqueName

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

getRolapMember

public final RolapMember getRolapMember()
Returns the underlying member. This is a member of a shared dimension and does not belong to a cube.

Returns:
Underlying member

getCube

public final RolapCube getCube()
Description copied from interface: RolapMemberInCube
Returns the cube this cube member belongs to.

This method is not in the RolapMember interface, because regular members may be shared, and therefore do not belong to a specific cube.

Specified by:
getCube in interface RolapMemberInCube
Returns:
Cube this cube member belongs to, never null

getDataMember

public final RolapCubeMember 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 DelegatingRolapMember

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class DelegatingRolapMember

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

equals

public boolean equals(OlapElement o)

getHierarchy

public final RolapCubeHierarchy getHierarchy()
Specified by:
getHierarchy in interface Member
Specified by:
getHierarchy in interface OlapElement
Specified by:
getHierarchy in interface RolapMember
Overrides:
getHierarchy in class DelegatingRolapMember

getDimension

public final RolapCubeDimension 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 DelegatingRolapMember

getLevel

public final RolapCubeLevel getLevel()

This method is central to how RolapCubeMember works. It allows a member from the cache to be used within different usages of the same shared dimension. The cache member is the same, but the RolapCubeMembers wrapping the cache member report that they belong to different levels, and hence different hierarchies, dimensions, and cubes.

Specified by:
getLevel in interface Member
Specified by:
getLevel in interface RolapMember
Overrides:
getLevel in class DelegatingRolapMember

setProperty

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

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

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 DelegatingRolapMember

getParentMember

public final RolapCubeMember 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 DelegatingRolapMember

getExpression

public Exp getExpression()
Specified by:
getExpression in interface Member
Overrides:
getExpression in class DelegatingRolapMember

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment childName,
                               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 DelegatingRolapMember

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