mondrian.rolap
Interface StarPredicate

All Known Subinterfaces:
StarColumnPredicate
All Known Implementing Classes:
AbstractColumnPredicate, AndPredicate, ListColumnPredicate, ListPredicate, LiteralStarPredicate, MemberColumnPredicate, MemberTuplePredicate, MinusStarPredicate, OrPredicate, RangeColumnPredicate, ValueColumnPredicate

public interface StarPredicate

Condition which constrains a set of values of a single RolapStar.Column or a set of columns.

For example, the predicate Range([Time].[1997].[Q3], [Time].[1998].[Q2]) constrains the year and quarter columns:

  ((year = 1997 and quarter >= 'Q3')
    or (year > 1997))
and ((year = 1998 and quarter <= 'Q2')
    or (year < 1998))

Since:
Jan 15, 2007
Author:
jhyde
 

Field Summary
static Object WILDCARD
          Wildcard value for evaluate(java.util.List).
 
Method Summary
 StarPredicate and(StarPredicate predicate)
          Returns this intersection of this Predicate with another.
 void describe(StringBuilder buf)
          Appends a description of this predicate to a StringBuilder.
 boolean equalConstraint(StarPredicate that)
          Returns whether this Predicate has the same constraining effect as the other constraint.
 boolean evaluate(List<Object> valueList)
          Evaluates a constraint against a list of values.
 BitKey getConstrainedColumnBitKey()
          Returns a bitmap of constrained columns to speed up comparison
 List<RolapStar.Column> getConstrainedColumnList()
          Returns a list of constrained columns.
 StarPredicate minus(StarPredicate predicate)
          Returns the logical inverse of this Predicate.
 StarPredicate or(StarPredicate predicate)
          Returns this union of this Predicate with another.
 void toSql(SqlQuery sqlQuery, StringBuilder buf)
           
 

Field Detail

WILDCARD

static final Object WILDCARD
Wildcard value for evaluate(java.util.List).

Method Detail

getConstrainedColumnList

List<RolapStar.Column> getConstrainedColumnList()
Returns a list of constrained columns.

Returns:
List of constrained columns

getConstrainedColumnBitKey

BitKey getConstrainedColumnBitKey()
Returns a bitmap of constrained columns to speed up comparison

Returns:
bitmap representing all constraining columns.

describe

void describe(StringBuilder buf)
Appends a description of this predicate to a StringBuilder. For example:

Parameters:
buf - Builder to append to

evaluate

boolean evaluate(List<Object> valueList)
Evaluates a constraint against a list of values.

If one of the values is WILDCARD, returns true if constraint is true for all possible values of that column.

Parameters:
valueList - List of values, one for each constrained column
Returns:
Whether constraint holds for given set of values

equalConstraint

boolean equalConstraint(StarPredicate that)
Returns whether this Predicate has the same constraining effect as the other constraint. This is weaker than Object.equals(Object): it is possible for two different members to constrain the same column in the same way.

Parameters:
that - Other predicate
Returns:
whether the other predicate is equivalent

minus

StarPredicate minus(StarPredicate predicate)
Returns the logical inverse of this Predicate. The result is a Predicate which holds whenever this predicate holds but the other does not.

Pre-condition:
predicate != null
Parameters:
predicate - Predicate
Returns:
Combined predicate

or

StarPredicate or(StarPredicate predicate)
Returns this union of this Predicate with another. The result is a Predicate which holds whenever either predicate holds.

Pre-condition:
predicate != null
Parameters:
predicate - Predicate
Returns:
Combined predicate

and

StarPredicate and(StarPredicate predicate)
Returns this intersection of this Predicate with another. The result is a Predicate which holds whenever both predicates hold.

Pre-condition:
predicate != null
Parameters:
predicate - Predicate
Returns:
Combined predicate

toSql

void toSql(SqlQuery sqlQuery,
           StringBuilder buf)

SourceForge.net_Logo