Package mondrian.rolap.agg
Class AbstractColumnPredicate
- java.lang.Object
-
- mondrian.rolap.agg.AbstractColumnPredicate
-
- All Implemented Interfaces:
StarColumnPredicate
,StarPredicate
- Direct Known Subclasses:
ListColumnPredicate
,LiteralStarPredicate
,MinusStarPredicate
,RangeColumnPredicate
,ValueColumnPredicate
public abstract class AbstractColumnPredicate extends Object implements StarColumnPredicate
AAbstractColumnPredicate
is an abstract implementation forStarColumnPredicate
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractColumnPredicate.Factory
Factory forStarPredicate
s andStarColumnPredicate
s.-
Nested classes/interfaces inherited from interface mondrian.rolap.StarColumnPredicate
StarColumnPredicate.Overlap
-
-
Field Summary
Fields Modifier and Type Field Description protected RolapStar.Column
constrainedColumn
-
Fields inherited from interface mondrian.rolap.StarPredicate
WILDCARD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractColumnPredicate(RolapStar.Column constrainedColumn)
Creates an AbstractColumnPredicate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StarPredicate
and(StarPredicate predicate)
Returns this intersection of this Predicate with another.protected static List<StarColumnPredicate>
cloneListWithColumn(RolapStar.Column column, List<StarColumnPredicate> list)
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.RolapStar.Column
getConstrainedColumn()
Returns the column constrained by this predicate.BitKey
getConstrainedColumnBitKey()
Returns a bitmap of constrained columns to speed up comparisonList<RolapStar.Column>
getConstrainedColumnList()
Returns a list of constrained columns.StarPredicate
or(StarPredicate predicate)
Returns this union of this Predicate with another.StarColumnPredicate
orColumn(StarColumnPredicate predicate)
Returns this union of this Predicate with another.void
toSql(SqlQuery sqlQuery, StringBuilder buf)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface mondrian.rolap.StarColumnPredicate
cloneWithColumn, evaluate, intersect, mightIntersect, minus, values
-
Methods inherited from interface mondrian.rolap.StarPredicate
describe
-
-
-
-
Field Detail
-
constrainedColumn
protected final RolapStar.Column constrainedColumn
-
-
Constructor Detail
-
AbstractColumnPredicate
protected AbstractColumnPredicate(RolapStar.Column constrainedColumn)
Creates an AbstractColumnPredicate.- Parameters:
constrainedColumn
- Constrained column
-
-
Method Detail
-
getConstrainedColumn
public RolapStar.Column getConstrainedColumn()
Description copied from interface:StarColumnPredicate
Returns the column constrained by this predicate.- Specified by:
getConstrainedColumn
in interfaceStarColumnPredicate
- Returns:
- Column constrained by this predicate.
-
getConstrainedColumnList
public List<RolapStar.Column> getConstrainedColumnList()
Description copied from interface:StarPredicate
Returns a list of constrained columns.- Specified by:
getConstrainedColumnList
in interfaceStarPredicate
- Returns:
- List of constrained columns
-
getConstrainedColumnBitKey
public BitKey getConstrainedColumnBitKey()
Description copied from interface:StarPredicate
Returns a bitmap of constrained columns to speed up comparison- Specified by:
getConstrainedColumnBitKey
in interfaceStarPredicate
- Returns:
- bitmap representing all constraining columns.
-
evaluate
public boolean evaluate(List<Object> valueList)
Description copied from interface:StarPredicate
Evaluates a constraint against a list of values.If one of the values is
StarPredicate.WILDCARD
, returns true if constraint is true for all possible values of that column.- Specified by:
evaluate
in interfaceStarPredicate
- Parameters:
valueList
- List of values, one for each constrained column- Returns:
- Whether constraint holds for given set of values
-
equalConstraint
public boolean equalConstraint(StarPredicate that)
Description copied from interface:StarPredicate
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.- Specified by:
equalConstraint
in interfaceStarPredicate
- Parameters:
that
- Other predicate- Returns:
- whether the other predicate is equivalent
-
or
public StarPredicate or(StarPredicate predicate)
Description copied from interface:StarPredicate
Returns this union of this Predicate with another. The result is a Predicate which holds whenever either predicate holds.- Specified by:
or
in interfaceStarPredicate
- Parameters:
predicate
- Predicate- Returns:
- Combined predicate
-
orColumn
public StarColumnPredicate orColumn(StarColumnPredicate predicate)
Description copied from interface:StarColumnPredicate
Returns this union of this Predicate with another.Unlike
StarPredicate.or(mondrian.rolap.StarPredicate)
, the other predicate must be on this column, and the result is a column predicate.- Specified by:
orColumn
in interfaceStarColumnPredicate
- Parameters:
predicate
- Another predicate on this column- Returns:
- Union predicate on this column
-
and
public StarPredicate and(StarPredicate predicate)
Description copied from interface:StarPredicate
Returns this intersection of this Predicate with another. The result is a Predicate which holds whenever both predicates hold.- Specified by:
and
in interfaceStarPredicate
- Parameters:
predicate
- Predicate- Returns:
- Combined predicate
-
toSql
public void toSql(SqlQuery sqlQuery, StringBuilder buf)
- Specified by:
toSql
in interfaceStarPredicate
-
cloneListWithColumn
protected static List<StarColumnPredicate> cloneListWithColumn(RolapStar.Column column, List<StarColumnPredicate> list)
-
-