Package mondrian.rolap.agg
Class CellRequest
- java.lang.Object
-
- mondrian.rolap.agg.CellRequest
-
- Direct Known Subclasses:
DrillThroughCellRequest
public class CellRequest extends Object
ACellRequestcontains the context necessary to get a cell value from a star.- Since:
- 21 March, 2002
- Author:
- jhyde
-
-
Field Summary
Fields Modifier and Type Field Description booleandrillThroughbooleanextendedContext
-
Constructor Summary
Constructors Constructor Description CellRequest(RolapStar.Measure measure, boolean extendedContext, boolean drillThrough)Creates aCellRequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAggregateList(BitKey compoundBitKey, StarPredicate compoundPredicate)Add compound member (formed via aggregate function) constraint to the Cell.voidaddConstrainedColumn(RolapStar.Column column, StarColumnPredicate predicate)Adds a constraint to this request.voidaddPredicateString(String predicateString)List<String>getCompoundPredicateStrings()RolapStar.Column[]getConstrainedColumns()BitKeygetConstrainedColumnsBitKey()Returns the BitKey for the list of columns.Map<String,Comparable>getMappedCellValues()Builds a map of column names to values, as specified by this cell request object.RolapStar.MeasuregetMeasure()Returns the measure of this cell request.intgetNumValues()Return the number of column constraints associated with this CellRequest.Object[]getSingleValues()Returns an array of the values for each column.StarColumnPredicategetValueAt(int index)Return the predicate value associated with the given index.booleanisUnsatisfiable()Returns whether this cell request is impossible to satisfy.
-
-
-
Constructor Detail
-
CellRequest
public CellRequest(RolapStar.Measure measure, boolean extendedContext, boolean drillThrough)
Creates aCellRequest.- Parameters:
measure- Measure the request is forextendedContext- If a drill-through request, whether to join in unconstrained levels so as to display extra columnsdrillThrough- Whether this is a request for a drill-through set
-
-
Method Detail
-
addConstrainedColumn
public final void addConstrainedColumn(RolapStar.Column column, StarColumnPredicate predicate)
Adds a constraint to this request.- Parameters:
column- Column to constraintpredicate- Constraint to apply, or null to add column to the output without applying constraint
-
addAggregateList
public void addAggregateList(BitKey compoundBitKey, StarPredicate compoundPredicate)
Add compound member (formed via aggregate function) constraint to the Cell.- Parameters:
compoundBitKey- Compound bit keycompoundPredicate- Compound predicate
-
addPredicateString
public void addPredicateString(String predicateString)
-
getMeasure
public RolapStar.Measure getMeasure()
Returns the measure of this cell request.- Returns:
- Measure
-
getConstrainedColumns
public RolapStar.Column[] getConstrainedColumns()
-
getConstrainedColumnsBitKey
public BitKey getConstrainedColumnsBitKey()
Returns the BitKey for the list of columns.- Returns:
- BitKey for the list of columns
-
getValueAt
public StarColumnPredicate getValueAt(int index)
Return the predicate value associated with the given index. Note that index is different than bit position; if there are three constraints then the indices are 0, 1, and 2, while the bitPositions could span a larger range.It is valid for the predicate at a given index to be null (there should always be a column at that index, but it may not have an associated predicate).
- Parameters:
index- Index of the constraint we're looking up- Returns:
- predicate value associated with the given index
-
getNumValues
public int getNumValues()
Return the number of column constraints associated with this CellRequest.- Returns:
- number of columns in the CellRequest
-
getSingleValues
public Object[] getSingleValues()
Returns an array of the values for each column.The caller must check whether this request is satisfiable before calling this method. May throw
NullPointerExceptionif request is not satisfiable.- Returns:
- Array of values for each column
-
getMappedCellValues
public Map<String,Comparable> getMappedCellValues()
Builds a map of column names to values, as specified by this cell request object.
-
isUnsatisfiable
public boolean isUnsatisfiable()
Returns whether this cell request is impossible to satisfy. This occurs when the same column has two or more inconsistent constraints.- Returns:
- whether this cell request is impossible to satisfy
-
-