Package mondrian.olap.fun
Class TestMember
- java.lang.Object
-
- mondrian.olap.fun.TestMember
-
- All Implemented Interfaces:
Comparable,Annotated,Member,OlapElement
public class TestMember extends Object implements Member
Mock implementation ofMemberfor 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
Constructors Constructor Description TestMember(String identifer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)List<Member>getAncestorMembers()Returns a list of the ancestor members of this member.Map<String,Annotation>getAnnotationMap()Returns a list of annotations.StringgetCaption()MembergetDataMember()Returns the system-generated data member that is associated with a nonleaf member of a dimension.intgetDepth()returns the depth of this member, which is not the level's depth in case of parent child dimensionsStringgetDescription()DimensiongetDimension()Returns the dimension of a this expression, or null if no dimension is defined.ExpgetExpression()HierarchygetHierarchy()LevelgetLevel()StringgetLocalized(OlapElement.LocalizedProperty prop, Locale locale)Returns the value of a property (caption or description) of this element in the given locale.Member.MemberTypegetMemberType()Returns the type of member.StringgetName()ComparablegetOrderKey()Returns the order key of the member (relative to its siblings); null if undefined or unavailable.intgetOrdinal()Returns the ordinal of the member.MembergetParentMember()Returns this member's parent, or null (not the 'null member', as returned byHierarchy.getNullMember()) if it has no parent.StringgetParentUniqueName()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.StringgetPropertyFormattedValue(String propertyName)Returns the formatted value of the property namedpropertyName.ObjectgetPropertyValue(String propertyName)Returns the value of the property namedpropertyName.ObjectgetPropertyValue(String propertyName, boolean matchCase)Returns the value of the property namedpropertyName, matching according to the required case-sensitivity.StringgetQualifiedName()Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".intgetSolveOrder()StringgetUniqueName()booleanisAll()Returns whether this is the 'all' member.booleanisCalculated()Returns whether this member is computed using either awith memberclause in an mdx query or a calculated member defined in cube.booleanisCalculatedInQuery()Returns whether this member is computed from aWITH MEMBERclause in an MDX query.booleanisChildOrEqualTo(Member member)Returns whethermemberis equal to, a child, or a descendent of thisMember.booleanisEvaluated()Returns whether this member should be evaluated within the Evaluator.booleanisHidden()Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy.booleanisMeasure()Returns whether this is a member of the measures dimension.booleanisNull()Returns whether this is the 'null member'.booleanisParentChildLeaf()booleanisParentChildPhysicalMember()booleanisVisible()Returns whether this element is visible to end-users.OlapElementlookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)Looks up a child element, returning null if it does not exist.voidsetName(String name)Only allowable if the member is part of theWITHclause of a query.voidsetProperty(String name, Object value)Sets a property of this member to a given value.StringtoString()
-
-
-
Constructor Detail
-
TestMember
public TestMember(String identifer)
-
-
Method Detail
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable
-
getParentMember
public Member getParentMember()
Description copied from interface:MemberReturns this member's parent, or null (not the 'null member', as returned byHierarchy.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:
getParentMemberin interfaceMember
-
getHierarchy
public Hierarchy getHierarchy()
- Specified by:
getHierarchyin interfaceMember- Specified by:
getHierarchyin interfaceOlapElement
-
getParentUniqueName
public String getParentUniqueName()
Description copied from interface:MemberReturns name of parent member, or empty string (not null) if we are the root.- Specified by:
getParentUniqueNamein interfaceMember
-
getMemberType
public Member.MemberType getMemberType()
Description copied from interface:MemberReturns the type of member.- Specified by:
getMemberTypein interfaceMember
-
isParentChildLeaf
public boolean isParentChildLeaf()
- Specified by:
isParentChildLeafin interfaceMember- Returns:
- True when the member is a leaf member, meaning it has no children
-
isParentChildPhysicalMember
public boolean isParentChildPhysicalMember()
- Specified by:
isParentChildPhysicalMemberin interfaceMember- Returns:
- True when the member is part of a Parent-Child hierarchy and it is a physical member. In a Parent Child Hierarchy without a closure table, each member needs to be treated as calculated. We need a way to distinguish between true calculated members and physical members that exist in the source data
-
setName
public void setName(String name)
Description copied from interface:MemberOnly allowable if the member is part of theWITHclause of a query.
-
isAll
public boolean isAll()
Description copied from interface:MemberReturns whether this is the 'all' member.
-
isMeasure
public boolean isMeasure()
Description copied from interface:MemberReturns whether this is a member of the measures dimension.
-
isNull
public boolean isNull()
Description copied from interface:MemberReturns whether this is the 'null member'.
-
isChildOrEqualTo
public boolean isChildOrEqualTo(Member member)
Description copied from interface:MemberReturns whethermemberis equal to, a child, or a descendent of thisMember.- Specified by:
isChildOrEqualToin interfaceMember
-
isCalculated
public boolean isCalculated()
Description copied from interface:MemberReturns whether this member is computed using either awith memberclause in an mdx query or a calculated member defined in cube.- Specified by:
isCalculatedin interfaceMember
-
isEvaluated
public boolean isEvaluated()
Description copied from interface:MemberReturns whether this member should be evaluated within the Evaluator.Normally
Member.isCalculated()andMember.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:
isEvaluatedin interfaceMember- Returns:
- true if evaluated
-
getSolveOrder
public int getSolveOrder()
- Specified by:
getSolveOrderin interfaceMember
-
getExpression
public Exp getExpression()
- Specified by:
getExpressionin interfaceMember
-
getAncestorMembers
public List<Member> getAncestorMembers()
Description copied from interface:MemberReturns a list of the ancestor members of this member.- Specified by:
getAncestorMembersin interfaceMember
-
isCalculatedInQuery
public boolean isCalculatedInQuery()
Description copied from interface:MemberReturns whether this member is computed from aWITH MEMBERclause in an MDX query.- Specified by:
isCalculatedInQueryin interfaceMember
-
getPropertyValue
public Object getPropertyValue(String propertyName)
Description copied from interface:MemberReturns the value of the property namedpropertyName. Name match is case-sensitive.- Specified by:
getPropertyValuein interfaceMember
-
getPropertyValue
public Object getPropertyValue(String propertyName, boolean matchCase)
Description copied from interface:MemberReturns the value of the property namedpropertyName, matching according to the required case-sensitivity.- Specified by:
getPropertyValuein interfaceMember
-
getPropertyFormattedValue
public String getPropertyFormattedValue(String propertyName)
Description copied from interface:MemberReturns the formatted value of the property namedpropertyName.- Specified by:
getPropertyFormattedValuein interfaceMember
-
setProperty
public void setProperty(String name, Object value)
Description copied from interface:MemberSets a property of this member to a given value.- Specified by:
setPropertyin interfaceMember
-
getProperties
public Property[] getProperties()
Description copied from interface:MemberReturns the definitions of the properties this member may have.- Specified by:
getPropertiesin interfaceMember
-
getOrdinal
public int getOrdinal()
Description copied from interface:MemberReturns the ordinal of the member.- Specified by:
getOrdinalin interfaceMember
-
getOrderKey
public Comparable getOrderKey()
Description copied from interface:MemberReturns the order key of the member (relative to its siblings); null if undefined or unavailable.- Specified by:
getOrderKeyin interfaceMember
-
isHidden
public boolean isHidden()
Description copied from interface:MemberReturns whether this member is 'hidden', as per the rules which define a ragged hierarchy.
-
getDepth
public int getDepth()
Description copied from interface:Memberreturns the depth of this member, which is not the level's depth in case of parent child dimensions
-
getDataMember
public Member getDataMember()
Description copied from interface:MemberReturns 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:
getDataMemberin interfaceMember
-
getUniqueName
public String getUniqueName()
- Specified by:
getUniqueNamein interfaceOlapElement
-
getName
public String getName()
- Specified by:
getNamein interfaceOlapElement
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceOlapElement
-
lookupChild
public OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)
Description copied from interface:OlapElementLooks up a child element, returning null if it does not exist.- Specified by:
lookupChildin interfaceOlapElement
-
getQualifiedName
public String getQualifiedName()
Description copied from interface:OlapElementReturns the name of this element qualified by its class, for example "hierarchy 'Customers'".- Specified by:
getQualifiedNamein interfaceOlapElement
-
getCaption
public String getCaption()
- Specified by:
getCaptionin interfaceOlapElement
-
getLocalized
public String getLocalized(OlapElement.LocalizedProperty prop, Locale locale)
Description copied from interface:OlapElementReturns the value of a property (caption or description) of this element in the given locale.- Specified by:
getLocalizedin interfaceOlapElementlocale- Locale- Returns:
- Localized caption or description
-
isVisible
public boolean isVisible()
Description copied from interface:OlapElementReturns 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:
isVisiblein interfaceOlapElement- Returns:
- Whether this element is visible
-
getDimension
public Dimension getDimension()
Description copied from interface:OlapElementReturns the dimension of a this expression, or null if no dimension is defined. Applicable only to set expressions.Example 1:
has dimension[Sales].children
[Sales].Example 2:
has dimension [Promotion Media].order(except([Promotion Media].[Media Type].members, {[Promotion Media].[Media Type].[No Media]}), [Measures].[Unit Sales], DESC)Example 3:
has no dimension (well, actually it is [Product] x [Gender], but we can't represent that, so we return null);CrossJoin([Product].[Product Department].members, [Gender].members)- Specified by:
getDimensionin interfaceOlapElement
-
getAnnotationMap
public Map<String,Annotation> getAnnotationMap()
Description copied from interface:AnnotatedReturns a list of annotations.The map may be empty, never null.
- Specified by:
getAnnotationMapin interfaceAnnotated- Returns:
- Map from annotation name to annotations.
-
-