Package 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 singleRolapStar.Column
or a set of columns.For example, the predicate
Range([Time].[1997].[Q3], [Time].[1998].[Q2])
constrains theyear
andquarter
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
Fields Modifier and Type Field Description static Object
WILDCARD
Wildcard value forevaluate(java.util.List)
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StarPredicate
and(StarPredicate predicate)
Returns this intersection of this Predicate with another.void
describe(StringBuilder buf)
Appends a description of this predicate to aStringBuilder
.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 comparisonList<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 forevaluate(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 aStringBuilder
. For example:- =any
- =5
- in (2, 4, 6)
- 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 thanObject.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.- 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.- 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.- Parameters:
predicate
- Predicate- Returns:
- Combined predicate
-
toSql
void toSql(SqlQuery sqlQuery, StringBuilder buf)
-
-