mondrian.olap
Class LevelBase

java.lang.Object
  extended by mondrian.olap.OlapElementBase
      extended by mondrian.olap.LevelBase
All Implemented Interfaces:
Level, OlapElement
Direct Known Subclasses:
RolapLevel

public abstract class LevelBase
extends OlapElementBase
implements Level

Skeleton implementation of Level

Since:
6 August, 2001
Author:
jhyde
 

Field Summary
protected  int approxRowCount
           
protected  int depth
           
protected  String description
           
protected  Hierarchy hierarchy
           
protected  LevelType levelType
           
protected  MemberFormatter memberFormatter
           
protected  String name
           
protected  String uniqueName
           
 
Fields inherited from class mondrian.olap.OlapElementBase
caption
 
Constructor Summary
protected LevelBase(Hierarchy hierarchy, String name, int depth, LevelType levelType)
           
 
Method Summary
 Level getChildLevel()
           
 int getDepth()
          Returns the depth of this level.
 String getDescription()
           
 Dimension getDimension()
          Returns the dimension of a this expression, or null if no dimension is defined.
 Hierarchy getHierarchy()
           
 LevelType getLevelType()
           
 MemberFormatter getMemberFormatter()
          Returns the object which is used to format members of this level.
 String getName()
           
 Level getParentLevel()
           
 String getQualifiedName()
          Returns the name of this element qualified by its class, for example "hierarchy 'Customers'".
 String getUniqueName()
           
abstract  boolean isAll()
           
 boolean isMeasure()
           
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s)
          Looks up a child element, returning null if it does not exist.
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment s, MatchType matchType)
           
 void setApproxRowCount(int approxRowCount)
          Sets the approximate number of members in this Level.
 
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, getCaption, getLogger, hashCode, setCaption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.olap.Level
areMembersUnique, getApproxRowCount, getInheritedProperties, getProperties
 
Methods inherited from interface mondrian.olap.OlapElement
getCaption
 

Field Detail

hierarchy

protected final Hierarchy hierarchy

name

protected final String name

uniqueName

protected final String uniqueName

description

protected String description

depth

protected final int depth

levelType

protected final LevelType levelType

memberFormatter

protected MemberFormatter memberFormatter

approxRowCount

protected int approxRowCount
Constructor Detail

LevelBase

protected LevelBase(Hierarchy hierarchy,
                    String name,
                    int depth,
                    LevelType levelType)
Method Detail

setApproxRowCount

public void setApproxRowCount(int approxRowCount)
Sets the approximate number of members in this Level.

See Also:
Level.getApproxRowCount()

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

getLevelType

public LevelType getLevelType()
Specified by:
getLevelType in interface Level

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

getHierarchy

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

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

getDepth

public int getDepth()
Description copied from interface: Level
Returns the depth of this level.

Note #1: In an access-controlled context, the first visible level of a hierarchy (as returned by SchemaReader.getHierarchyLevels(mondrian.olap.Hierarchy)) may not have a depth of 0.

Note #2: In a parent-child hierarchy, the depth of a member (as returned by SchemaReader.getMemberDepth(mondrian.olap.Member)) may not be the same as the depth of its level.

Specified by:
getDepth in interface Level

getChildLevel

public Level getChildLevel()
Specified by:
getChildLevel in interface Level

getParentLevel

public Level getParentLevel()
Specified by:
getParentLevel in interface Level

isAll

public abstract boolean isAll()
Specified by:
isAll in interface Level

isMeasure

public boolean isMeasure()

lookupChild

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

Specified by:
lookupChild in interface OlapElement

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment s,
                               MatchType matchType)
Specified by:
lookupChild in interface OlapElement

getMemberFormatter

public MemberFormatter getMemberFormatter()
Returns the object which is used to format members of this level.

Specified by:
getMemberFormatter in interface Level
Returns:
the MemberFormatter

SourceForge.net_Logo