Package mondrian.olap

Class CubeBase

All Implemented Interfaces:
Annotated, Cube, OlapElement
Direct Known Subclasses:
RolapCube

public abstract class CubeBase extends OlapElementBase implements Cube
CubeBase is an abstract implementation of Cube.
Since:
6 August, 2001
Author:
jhyde
  • Field Details

  • Constructor Details

    • CubeBase

      protected CubeBase(String name, String caption, boolean visible, String description, Dimension[] dimensions)
      Creates a CubeBase.
      Parameters:
      name - Name
      caption - Caption
      description - Description
      dimensions - List of dimensions
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Cube
      Specified by:
      getName in interface OlapElement
    • getUniqueName

      public String getUniqueName()
      Specified by:
      getUniqueName 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
    • 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
    • getHierarchy

      public Hierarchy getHierarchy()
      Specified by:
      getHierarchy in interface OlapElement
    • getDescription

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

      public Dimension[] getDimensions()
      Description copied from interface: Cube
      Returns the dimensions of this cube.
      Specified by:
      getDimensions in interface Cube
    • lookupHierarchy

      public Hierarchy lookupHierarchy(Id.NameSegment s, boolean unique)
      Description copied from interface: Cube
      Finds a hierarchy whose name (or unique name, if unique is true) equals s.
      Specified by:
      lookupHierarchy in interface Cube
    • 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
    • lookupDimension

      public Dimension lookupDimension(Id.Segment s)
      Looks up a dimension in this cube based on a component of its name.
      Parameters:
      s - Name segment
      Returns:
      Dimension, or null if not found
    • getYearLevel

      public Level getYearLevel()
      Description copied from interface: Cube
      Helper method that returns the Year Level or returns null if the Time Dimension does not exist or if Year is not defined in the Time Dimension.
      Specified by:
      getYearLevel in interface Cube
      Returns:
      Level or null.
    • getQuarterLevel

      public Level getQuarterLevel()
      Description copied from interface: Cube
      Return Quarter Level or null.
      Specified by:
      getQuarterLevel in interface Cube
      Returns:
      Quarter Level or null.
    • getMonthLevel

      public Level getMonthLevel()
      Description copied from interface: Cube
      Return Month Level or null.
      Specified by:
      getMonthLevel in interface Cube
      Returns:
      Month Level or null.
    • getWeekLevel

      public Level getWeekLevel()
      Description copied from interface: Cube
      Return Week Level or null.
      Specified by:
      getWeekLevel in interface Cube
      Returns:
      Week Level or null.