mondrian.rolap.agg
Class AggregationKey

java.lang.Object
  extended by mondrian.rolap.agg.AggregationKey

public class AggregationKey
extends Object

Column context that an Aggregation is computed for.

Column context has two components:

Any column is only used in either column context or compound context, not both.

Author:
Rushan Chen

Field Summary
(package private)  List<StarPredicate> compoundPredicateList
          List of StarPredicate (representing the predicate defining the compound member).
 
Constructor Summary
AggregationKey(CellRequest request)
          Creates an AggregationKey.
 
Method Summary
 int computeHashCode()
           
static int computeHashCode(BitKey constrainedColumnsBitKey, RolapStar star, Collection<BitKey> compoundPredicateBitKeys)
           
(package private) static boolean equal(List<StarPredicate> list1, List<StarPredicate> list2)
          Returns whether two lists of compound predicates are equal.
 boolean equals(Object other)
           
 List<StarPredicate> getCompoundPredicateList()
          Returns the list of compound predicates.
static List<String> getCompoundPredicateStringList(RolapStar star, List<StarPredicate> compoundPredicateList)
          Returns a list of compound predicates, expressed as SQL strings.
 BitKey getConstrainedColumnsBitKey()
          Returns the bitkey of columns that constrain this aggregation.
 RolapStar getStar()
          Returns the star.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

compoundPredicateList

final List<StarPredicate> compoundPredicateList
List of StarPredicate (representing the predicate defining the compound member).

In sorted order of BitKey. This ensures that the map is deternimistic (otherwise different runs generate SQL statements in different orders), and speeds up comparison.

Constructor Detail

AggregationKey

public AggregationKey(CellRequest request)
Creates an AggregationKey.

Parameters:
request - Cell request
Method Detail

computeHashCode

public final int computeHashCode()

computeHashCode

public static int computeHashCode(BitKey constrainedColumnsBitKey,
                                  RolapStar star,
                                  Collection<BitKey> compoundPredicateBitKeys)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equal

static boolean equal(List<StarPredicate> list1,
                     List<StarPredicate> list2)
Returns whether two lists of compound predicates are equal.

Parameters:
list1 - First compound predicate map
list2 - Second compound predicate map
Returns:
Whether compound predicate maps are equal

toString

public String toString()
Overrides:
toString in class Object

getConstrainedColumnsBitKey

public final BitKey getConstrainedColumnsBitKey()
Returns the bitkey of columns that constrain this aggregation.

Returns:
Bitkey of contraining columns

getStar

public final RolapStar getStar()
Returns the star.

Returns:
Star

getCompoundPredicateList

public List<StarPredicate> getCompoundPredicateList()
Returns the list of compound predicates.

Returns:
list of predicates

getCompoundPredicateStringList

public static List<String> getCompoundPredicateStringList(RolapStar star,
                                                          List<StarPredicate> compoundPredicateList)
Returns a list of compound predicates, expressed as SQL strings.

Parameters:
star - Star
compoundPredicateList - Predicate list
Returns:
list of predicate strings

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads