mondrian.olap.fun
Class TestMember

java.lang.Object
  extended by mondrian.olap.fun.TestMember
All Implemented Interfaces:
Comparable, Annotated, Member, OlapElement

public class TestMember
extends Object
implements Member

Mock implementation of Member for testing.

Author:
Richard M. Emberson

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.olap.Member
Member.MemberType
 
Nested classes/interfaces inherited from interface mondrian.olap.OlapElement
OlapElement.LocalizedProperty
 
Constructor Summary
TestMember(String identifer)
           
 
Method Summary
 int compareTo(Object o)
           
 List<Member> getAncestorMembers()
          Returns a list of the ancestor members of this member.
 Map<String,Annotation> getAnnotationMap()
          Returns a list of annotations.
 String getCaption()
           
 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()
           
 Hierarchy getHierarchy()
           
 Level getLevel()
           
 String getLocalized(OlapElement.LocalizedProperty prop, Locale locale)
          Returns the value of a property (caption or description) of this element in the given locale.
 Member.MemberType getMemberType()
          Returns the type of member.
 String getName()
           
 Comparable getOrderKey()
          Returns the order key of the member (relative to its siblings); null if undefined or unavailable.
 int getOrdinal()
          Returns the ordinal of the member.
 Member 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()
           
 String getUniqueName()
           
 boolean isAll()
          Returns whether this is the 'all' member.
 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 member)
          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()
           
 boolean isVisible()
          Returns whether this element is visible to end-users.
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestMember

public TestMember(String identifer)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

compareTo

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

getParentMember

public Member 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

getLevel

public Level getLevel()
Specified by:
getLevel in interface Member

getHierarchy

public Hierarchy getHierarchy()
Specified by:
getHierarchy in interface Member
Specified by:
getHierarchy in interface OlapElement

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

getMemberType

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

Specified by:
getMemberType in interface Member

isParentChildLeaf

public boolean isParentChildLeaf()
Specified by:
isParentChildLeaf in interface Member

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

isAll

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

Specified by:
isAll in interface Member

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

isNull

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

Specified by:
isNull in interface Member

isChildOrEqualTo

public boolean isChildOrEqualTo(Member member)
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

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

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
Returns:
true if evaluated

getSolveOrder

public int getSolveOrder()
Specified by:
getSolveOrder in interface Member

getExpression

public Exp getExpression()
Specified by:
getExpression in interface Member

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

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

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

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

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

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

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

getOrdinal

public int getOrdinal()
Description copied from interface: Member
Returns the ordinal of the member.

Specified by:
getOrdinal in interface Member

getOrderKey

public Comparable getOrderKey()
Description copied from interface: Member
Returns the order key of the member (relative to its siblings); null if undefined or unavailable.

Specified by:
getOrderKey in interface Member

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

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
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

getUniqueName

public String getUniqueName()
Specified by:
getUniqueName in interface OlapElement

getName

public String getName()
Specified by:
getName in interface OlapElement

getDescription

public String getDescription()
Specified by:
getDescription in interface OlapElement

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

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

getCaption

public String getCaption()
Specified by:
getCaption in interface OlapElement

getLocalized

public String getLocalized(OlapElement.LocalizedProperty prop,
                           Locale locale)
Description copied from interface: OlapElement
Returns the value of a property (caption or description) of this element in the given locale.

Specified by:
getLocalized in interface OlapElement
locale - Locale
Returns:
Localized caption or description

isVisible

public boolean isVisible()
Description copied from interface: OlapElement
Returns whether this element is visible to end-users.

Visibility is a hint for client applications. An element's visibility does not affect how it is treated when MDX queries are evaluated.

Specified by:
isVisible in interface OlapElement
Returns:
Whether this element is visible

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

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
Returns:
Map from annotation name to annotations.

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