mondrian.rolap.aggmatcher
Class AggStar

java.lang.Object
  extended by mondrian.rolap.aggmatcher.AggStar

public class AggStar
extends Object

This is an aggregate table version of a RolapStar for a fact table.

There is the following class structure:

 AggStar
   Table
     JoinCondition
     Column
     Level extends Column
   FactTable extends Table
     Measure extends Table.Column
   DimTable extends Table
 
 Each inner class is non-static meaning that instances have implied references
 to the enclosing object.

Author:
Richard M. Emberson
 

Nested Class Summary
 class AggStar.DimTable
          This class represents a dimension table.
 class AggStar.FactTable
          This is an aggregate fact table.
 class AggStar.Table
          Base Table class for the FactTable and DimTable classes.
 
Constructor Summary
AggStar(RolapStar star, JdbcSchema.Table aggTable)
           
 
Method Summary
 AggStar.Table findTable(String name)
          Find a table by name (alias) that is a descendant of the base fact table.
 BitKey getBitKey()
          Returns the BitKey.
 BitKey getDistinctMeasureBitKey()
          Returns a BitKey containing only distinct measures.
 AggStar.FactTable getFactTable()
          Get the fact table.
 BitKey getForeignKeyBitKey()
           
 BitKey getLevelBitKey()
          Get the foreign-key/level BitKey.
(package private) static org.apache.log4j.Logger getLogger()
           
 BitKey getMeasureBitKey()
          Returns a BitKey of all measures.
 int getSize()
          Returns a measure of the IO cost of querying this table.
 RolapStar getStar()
          Get this AggStar's RolapStar.
 boolean hasForeignKeys()
          Returns whether this AggStar has foreign keys.
 boolean hasLevels()
          Return true if AggStar has levels
 boolean hasMeasures()
          Return true if AggStar has measures
 AggStar.Table.Column lookupColumn(int bitPos)
          Get the Column at the bit position.
 AggStar.Table.Level lookupLevel(int bitPos)
          Get the Level at the given bit position or return null.
 AggStar.FactTable.Measure lookupMeasure(int bitPos)
          Get the Measure at the given bit position or return null.
static AggStar makeAggStar(RolapStar star, JdbcSchema.Table dbTable, MessageRecorder msgRecorder)
          Creates an AggStar and all of its AggStar.Table, AggStar.Table.Columns, etc.
 void print(PrintWriter pw, String prefix)
          Print this AggStar.
 boolean select(BitKey levelBitKey, BitKey coreLevelBitKey, BitKey measureBitKey)
          Return true if this AggStar's level BitKey equals the levelBitKey parameter and if this AggStar's measure BitKey is a super set (proper or not) of the measureBitKey parameter.
(package private)  void setForeignKey(int index)
           
 boolean superSetMatch(BitKey bitKey)
          Is this AggStar's BitKey a super set (proper or not) of the BitKey parameter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggStar

AggStar(RolapStar star,
        JdbcSchema.Table aggTable)
Method Detail

getLogger

static org.apache.log4j.Logger getLogger()

makeAggStar

public static AggStar makeAggStar(RolapStar star,
                                  JdbcSchema.Table dbTable,
                                  MessageRecorder msgRecorder)
Creates an AggStar and all of its AggStar.Table, AggStar.Table.Columns, etc.


getFactTable

public AggStar.FactTable getFactTable()
Get the fact table.

Returns:
the fact table

findTable

public AggStar.Table findTable(String name)
Find a table by name (alias) that is a descendant of the base fact table.

Parameters:
name - the table to find
Returns:
the table or null

getSize

public int getSize()
Returns a measure of the IO cost of querying this table. It can be either the row count or the row count times the size of a row. If the property MondrianProperties.ChooseAggregateByVolume is true, then volume is returned, otherwise row count.


setForeignKey

void setForeignKey(int index)

getForeignKeyBitKey

public BitKey getForeignKeyBitKey()

superSetMatch

public boolean superSetMatch(BitKey bitKey)
Is this AggStar's BitKey a super set (proper or not) of the BitKey parameter.

Parameters:
bitKey -
Returns:
true if it is a super set

select

public boolean select(BitKey levelBitKey,
                      BitKey coreLevelBitKey,
                      BitKey measureBitKey)
Return true if this AggStar's level BitKey equals the levelBitKey parameter and if this AggStar's measure BitKey is a super set (proper or not) of the measureBitKey parameter.


getStar

public RolapStar getStar()
Get this AggStar's RolapStar.


hasMeasures

public boolean hasMeasures()
Return true if AggStar has measures


hasLevels

public boolean hasLevels()
Return true if AggStar has levels


hasForeignKeys

public boolean hasForeignKeys()
Returns whether this AggStar has foreign keys.


getBitKey

public BitKey getBitKey()
Returns the BitKey.


getLevelBitKey

public BitKey getLevelBitKey()
Get the foreign-key/level BitKey.


getMeasureBitKey

public BitKey getMeasureBitKey()
Returns a BitKey of all measures.


getDistinctMeasureBitKey

public BitKey getDistinctMeasureBitKey()
Returns a BitKey containing only distinct measures.


lookupMeasure

public AggStar.FactTable.Measure lookupMeasure(int bitPos)
Get the Measure at the given bit position or return null. Note that there is no check that the bit position is within the range of the array of columns. Nor is there a check that the column type at that position is a Measure.

Parameters:
bitPos -
Returns:
A Measure or null.

lookupLevel

public AggStar.Table.Level lookupLevel(int bitPos)
Get the Level at the given bit position or return null. Note that there is no check that the bit position is within the range of the array of columns. Nor is there a check that the column type at that position is a Level.

Parameters:
bitPos -
Returns:
A Level or null.

lookupColumn

public AggStar.Table.Column lookupColumn(int bitPos)
Get the Column at the bit position. Note that there is no check that the bit position is within the range of the array of columns.


toString

public String toString()
Overrides:
toString in class Object

print

public void print(PrintWriter pw,
                  String prefix)
Print this AggStar.

Parameters:
pw -
prefix -

SourceForge.net_Logo