mondrian.rolap
Class RolapLevel

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

public class RolapLevel
extends LevelBase

RolapLevel implements Level for a ROLAP database.

Since:
10 August, 2001
Author:
jhyde
 

Nested Class Summary
static class RolapLevel.HideMemberCondition
          Conditions under which a level's members may be hidden (thereby creating a ragged hierarchy).
 
Field Summary
protected  MondrianDef.Expression captionExp
          The column or expression which yields the level members' caption.
(package private) static int FLAG_ALL
           
(package private) static int FLAG_UNIQUE
          For SQL generator.
protected  MondrianDef.Expression keyExp
          The column or expression which yields the level's key.
protected  MondrianDef.Expression nameExp
          Ths expression which gives the name of members of this level.
protected  MondrianDef.Expression ordinalExp
          The column or expression which yields the level's ordinal.
protected  MondrianDef.Expression parentExp
          The expression which joins to the parent member in a parent-child hierarchy, or null if this is a regular hierarchy.
protected  MondrianDef.Closure xmlClosure
           
 
Fields inherited from class mondrian.olap.LevelBase
approxRowCount, depth, description, hierarchy, levelType, memberFormatter, name, uniqueName
 
Fields inherited from class mondrian.olap.OlapElementBase
caption
 
Constructor Summary
RolapLevel(RolapHierarchy hierarchy, int depth, MondrianDef.Level xmlLevel)
           
RolapLevel(RolapHierarchy hierarchy, int depth, String name, MondrianDef.Expression keyExp, MondrianDef.Expression nameExp, MondrianDef.Expression captionExp, MondrianDef.Expression ordinalExp, MondrianDef.Expression parentExp, String nullParentValue, MondrianDef.Closure xmlClosure, RolapProperty[] properties, int flags, SqlQuery.Datatype datatype, RolapLevel.HideMemberCondition hideMemberCondition, LevelType levelType, String approxRowCount)
          Creates a level.
 
Method Summary
 boolean areMembersUnique()
           
 int getApproxRowCount()
          Returns the approximate number of members in this level, or Integer.MIN_VALUE if no approximation is known.
 MondrianDef.Expression getCaptionExp()
           
 RolapLevel getClosedPeer()
           
(package private)  SqlQuery.Datatype getDatatype()
           
(package private)  int getFlags()
           
(package private)  RolapLevel.HideMemberCondition getHideMemberCondition()
           
 RolapHierarchy getHierarchy()
           
 Property[] getInheritedProperties()
          Returns properties defined against this level and parent levels.
 MondrianDef.Expression getKeyExp()
           
protected  org.apache.log4j.Logger getLogger()
           
 MondrianDef.Expression getNameExp()
           
(package private)  String getNullParentValue()
           
(package private)  MondrianDef.Expression getOrdinalExp()
           
(package private)  MondrianDef.Expression getParentExp()
           
 RolapProperty[] getProperties()
          Returns properties defined against this level.
 String getTableAlias()
           
(package private)  String getTableName()
           
 boolean hasCaptionColumn()
           
(package private)  boolean hasClosedPeer()
          Returns true when the level is part of a parent/child hierarchy and has an equivalent closed level.
(package private)  void init(MondrianDef.CubeDimension xmlDimension)
           
 boolean isAll()
           
 boolean isParentChild()
          Returns whether this level is parent-child.
 boolean isUnique()
           
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment name)
          Looks up a child element, returning null if it does not exist.
 OlapElement lookupChild(SchemaReader schemaReader, Id.Segment name, MatchType matchType)
           
static RolapLevel lookupLevel(RolapLevel[] levels, String levelName)
           
 
Methods inherited from class mondrian.olap.LevelBase
getChildLevel, getDepth, getDescription, getDimension, getLevelType, getMemberFormatter, getName, getParentLevel, getQualifiedName, getUniqueName, isMeasure, setApproxRowCount
 
Methods inherited from class mondrian.olap.OlapElementBase
clone, computeHashCode, equals, equals, getCaption, hashCode, setCaption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mondrian.olap.OlapElement
getCaption
 

Field Detail

keyExp

protected MondrianDef.Expression keyExp
The column or expression which yields the level's key.


ordinalExp

protected MondrianDef.Expression ordinalExp
The column or expression which yields the level's ordinal.


captionExp

protected MondrianDef.Expression captionExp
The column or expression which yields the level members' caption.


FLAG_ALL

static final int FLAG_ALL
See Also:
Constant Field Values

FLAG_UNIQUE

static final int FLAG_UNIQUE
For SQL generator. Whether values of "column" are unique globally unique (as opposed to unique only within the context of the parent member).

See Also:
Constant Field Values

nameExp

protected MondrianDef.Expression nameExp
Ths expression which gives the name of members of this level. If null, members are named using the key expression.


parentExp

protected MondrianDef.Expression parentExp
The expression which joins to the parent member in a parent-child hierarchy, or null if this is a regular hierarchy.


xmlClosure

protected final MondrianDef.Closure xmlClosure
Constructor Detail

RolapLevel

RolapLevel(RolapHierarchy hierarchy,
           int depth,
           String name,
           MondrianDef.Expression keyExp,
           MondrianDef.Expression nameExp,
           MondrianDef.Expression captionExp,
           MondrianDef.Expression ordinalExp,
           MondrianDef.Expression parentExp,
           String nullParentValue,
           MondrianDef.Closure xmlClosure,
           RolapProperty[] properties,
           int flags,
           SqlQuery.Datatype datatype,
           RolapLevel.HideMemberCondition hideMemberCondition,
           LevelType levelType,
           String approxRowCount)
Creates a level.

Pre-condition:
parentExp != null || nullParentValue == null, properties != null, levelType != null, hideMemberCondition != null

RolapLevel

RolapLevel(RolapHierarchy hierarchy,
           int depth,
           MondrianDef.Level xmlLevel)
Method Detail

getHierarchy

public RolapHierarchy getHierarchy()
Specified by:
getHierarchy in interface Level
Specified by:
getHierarchy in interface OlapElement
Overrides:
getHierarchy in class LevelBase

getLogger

protected org.apache.log4j.Logger getLogger()
Specified by:
getLogger in class OlapElementBase

getTableName

String getTableName()

getKeyExp

public MondrianDef.Expression getKeyExp()

getOrdinalExp

MondrianDef.Expression getOrdinalExp()

getCaptionExp

public MondrianDef.Expression getCaptionExp()

hasCaptionColumn

public boolean hasCaptionColumn()

getFlags

final int getFlags()

getHideMemberCondition

RolapLevel.HideMemberCondition getHideMemberCondition()

isUnique

public final boolean isUnique()

getDatatype

final SqlQuery.Datatype getDatatype()

getNullParentValue

final String getNullParentValue()

isParentChild

public boolean isParentChild()
Returns whether this level is parent-child.


getParentExp

MondrianDef.Expression getParentExp()

getNameExp

public MondrianDef.Expression getNameExp()

init

void init(MondrianDef.CubeDimension xmlDimension)

isAll

public final boolean isAll()
Specified by:
isAll in interface Level
Specified by:
isAll in class LevelBase

areMembersUnique

public boolean areMembersUnique()

getTableAlias

public String getTableAlias()

getProperties

public RolapProperty[] getProperties()
Description copied from interface: Level
Returns properties defined against this level.


getInheritedProperties

public Property[] getInheritedProperties()
Description copied from interface: Level
Returns properties defined against this level and parent levels.


getApproxRowCount

public int getApproxRowCount()
Description copied from interface: Level
Returns the approximate number of members in this level, or Integer.MIN_VALUE if no approximation is known.


lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment name)
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 LevelBase

lookupChild

public OlapElement lookupChild(SchemaReader schemaReader,
                               Id.Segment name,
                               MatchType matchType)
Specified by:
lookupChild in interface OlapElement
Overrides:
lookupChild in class LevelBase

hasClosedPeer

boolean hasClosedPeer()
Returns true when the level is part of a parent/child hierarchy and has an equivalent closed level.


getClosedPeer

public RolapLevel getClosedPeer()

lookupLevel

public static RolapLevel lookupLevel(RolapLevel[] levels,
                                     String levelName)

SourceForge.net_Logo