mondrian.rolap.agg
Class AbstractColumnPredicate

java.lang.Object
  extended by 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

A AbstractColumnPredicate is an abstract implementation for StarColumnPredicate.

Version:
$Id: //open/mondrian-release/3.0/src/main/mondrian/rolap/agg/AbstractColumnPredicate.java#3 $

Nested Class Summary
static class AbstractColumnPredicate.Factory
          Factory for StarPredicates and StarColumnPredicates.
 
Nested classes/interfaces inherited from interface mondrian.rolap.StarColumnPredicate
StarColumnPredicate.Overlap
 
Field Summary
protected  RolapStar.Column constrainedColumn
           
 
Fields inherited from interface mondrian.rolap.StarPredicate
WILDCARD
 
Constructor Summary
protected AbstractColumnPredicate(RolapStar.Column constrainedColumn)
          Creates an AbstractColumnPredicate.
 
Method Summary
 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 comparison
 List<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

toString

public String toString()
Overrides:
toString in class Object

getConstrainedColumn

public RolapStar.Column getConstrainedColumn()
Description copied from interface: StarColumnPredicate
Returns the column constrained by this predicate.

Specified by:
getConstrainedColumn in interface StarColumnPredicate
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 interface StarPredicate
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 interface StarPredicate
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 interface StarPredicate
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 than Object.equals(Object): it is possible for two different members to constrain the same column in the same way.

Specified by:
equalConstraint in interface StarPredicate
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 interface StarPredicate
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 interface StarColumnPredicate
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 interface StarPredicate
Parameters:
predicate - Predicate
Returns:
Combined predicate

toSql

public void toSql(SqlQuery sqlQuery,
                  StringBuilder buf)
Specified by:
toSql in interface StarPredicate

cloneListWithColumn

protected static List<StarColumnPredicate> cloneListWithColumn(RolapStar.Column column,
                                                               List<StarColumnPredicate> list)

SourceForge.net_Logo