本文整理汇总了Java中mondrian.rolap.RolapMember类的典型用法代码示例。如果您正苦于以下问题:Java RolapMember类的具体用法?Java RolapMember怎么用?Java RolapMember使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RolapMember类属于mondrian.rolap包,在下文中一共展示了RolapMember类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Bound
import mondrian.rolap.RolapMember; //导入依赖的package包/类
Bound(RolapMember member, RelOp relOp) {
this.member = member;
List<Object> valueList = new ArrayList<Object>();
List<RelOp> relOpList = new ArrayList<RelOp>();
while (true) {
valueList.add(0, member.getKey());
relOpList.add(0, relOp);
if (member.getLevel().isUnique()) {
break;
}
member = member.getParentMember();
relOp = relOp.desctrict();
}
this.values = valueList.toArray(new Object[valueList.size()]);
this.relOps = relOpList.toArray(new RelOp[relOpList.size()]);
}
示例2: getBaseCubeofMeasure
import mondrian.rolap.RolapMember; //导入依赖的package包/类
private RolapCube getBaseCubeofMeasure(
Evaluator evaluator, Member member, RolapCube baseCube)
{
final Cube[] cubes = evaluator.getSchemaReader().getCubes();
for (Cube cube1 : cubes) {
RolapCube cube = (RolapCube) cube1;
if (!cube.isVirtual()) {
for (RolapMember measure : cube.getMeasuresMembers()) {
if (measure.getName().equals(member.getName())) {
baseCube = cube;
}
}
}
if (baseCube != null) {
break;
}
}
return baseCube;
}
示例3: MemberTuplePredicate
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* Creates a MemberTuplePredicate which evaluates to true for a given
* range of members.
*
* <p>The range can be open above or below, but at least one bound is
* required.
*
* @param baseCube base cube for virtual members
* @param lower Member which forms the lower bound, or null if range is
* open below
* @param lowerStrict Whether lower bound of range is strict
* @param upper Member which forms the upper bound, or null if range is
* open above
* @param upperStrict Whether upper bound of range is strict
*/
public MemberTuplePredicate(
RolapCube baseCube,
RolapMember lower,
boolean lowerStrict,
RolapMember upper,
boolean upperStrict)
{
columnBitKey = null;
this.columnList =
computeColumnList(lower != null ? lower : upper, baseCube);
if (lower == null) {
assert upper != null;
bounds = new Bound[] {
new Bound(upper, upperStrict ? RelOp.LT : RelOp.LE)
};
} else if (upper == null) {
bounds = new Bound[] {
new Bound(lower, lowerStrict ? RelOp.GT : RelOp.GE)
};
} else {
bounds = new Bound[] {
new Bound(lower, lowerStrict ? RelOp.GT : RelOp.GE),
new Bound(upper, upperStrict ? RelOp.LT : RelOp.LE)
};
}
}
示例4: computeColumnList
import mondrian.rolap.RolapMember; //导入依赖的package包/类
private List<RolapStar.Column> computeColumnList(
RolapMember member,
RolapCube baseCube)
{
List<RolapStar.Column> columnList = new ArrayList<RolapStar.Column>();
while (true) {
RolapLevel level = member.getLevel();
RolapStar.Column column = null;
if (level instanceof RolapCubeLevel) {
column = ((RolapCubeLevel)level)
.getBaseStarKeyColumn(baseCube);
} else {
(new Exception()).printStackTrace();
}
if (columnBitKey == null) {
columnBitKey =
BitKey.Factory.makeBitKey(
column.getStar().getColumnCount());
columnBitKey.clear();
}
columnBitKey.set(column.getBitPosition());
columnList.add(0, column);
if (level.isUnique()) {
return columnList;
}
member = member.getParentMember();
}
}
示例5: processUnrelatedDimensions
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* Pushes unrelated dimensions to the top level member from the given list
* of tuples if the ignoreUnrelatedDimensions property is set on the base
* cube usage in the virtual cube.
*
* <p>If IgnoreMeasureForNonJoiningDimension is set to true and
* ignoreUnrelatedDimensions on CubeUsage is set to false then if a non
* joining dimension exists in the aggregation list then return an empty
* list else return the original list.
*
* @param tuplesForAggregation is a list of members or tuples used in
* computing the aggregate
* @param evaluator
* @return list of members or tuples
*/
private static List processUnrelatedDimensions(
List tuplesForAggregation,
Evaluator evaluator)
{
if (tuplesForAggregation.size() == 0) {
return tuplesForAggregation;
}
RolapMember measure = (RolapMember) evaluator.getMembers()[0];
if (measure.isCalculated()) {
return tuplesForAggregation;
}
RolapCube virtualCube = (RolapCube) evaluator.getCube();
RolapCube baseCube = (RolapCube) evaluator.getMeasureCube();
if (virtualCube.isVirtual() && baseCube != null) {
if (virtualCube.shouldIgnoreUnrelatedDimensions(baseCube.getName()))
{
return ignoreUnrelatedDimensions(
tuplesForAggregation, baseCube);
} else if (MondrianProperties.instance()
.IgnoreMeasureForNonJoiningDimension.get())
{
return ignoreMeasureForNonJoiningDimension(
tuplesForAggregation, baseCube);
}
}
return tuplesForAggregation;
}
示例6: findCountMeasure
import mondrian.rolap.RolapMember; //导入依赖的package包/类
private static RolapMember findCountMeasure(final RolapCube cube) {
for (RolapMember member : cube.getMeasuresMembers()) {
if (member instanceof RolapStoredMeasure) {
RolapStoredMeasure measure = (RolapStoredMeasure) member;
if (measure.getAggregator() == RolapAggregator .Count) {
return member;
}
}
}
return null;
// throw new RuntimeException("Cube does not have a 'count' measure");
}
示例7: findRolapMeasure
import mondrian.rolap.RolapMember; //导入依赖的package包/类
private RolapBaseCubeMeasure findRolapMeasure(Schema schema, Measure measure) {
RolapCube cube = ((MondrianSchema)schema).getRolapCube();
for (RolapMember member : cube.getMeasuresMembers()) {
// skip over calculated measures, etc
if (member instanceof RolapBaseCubeMeasure) {
RolapBaseCubeMeasure rolapMeasure = (RolapBaseCubeMeasure)member;
if (rolapMeasure.getStarMeasure() == ((MondrianMeasure)measure).getRolapStarMeasure()) {
return rolapMeasure;
}
}
}
return null;
}
示例8: populateHierarchy
import mondrian.rolap.RolapMember; //导入依赖的package包/类
protected void populateHierarchy(
SchemaReader schemaReader,
String catalogName,
Cube cube,
Dimension dimension,
HierarchyBase hierarchy,
int ordinal,
List<Row> rows)
throws XmlaException
{
// Access control
if (!canAccess(schemaReader, hierarchy)) {
return;
}
String desc = hierarchy.getDescription();
if (desc == null) {
desc =
cube.getName() + " Cube - "
+ getHierarchyName(hierarchy) + " Hierarchy";
}
Row row = new Row();
row.set(CatalogName.name, catalogName);
row.set(SchemaName.name, cube.getSchema().getName());
row.set(CubeName.name, cube.getName());
row.set(DimensionUniqueName.name, dimension.getUniqueName());
row.set(HierarchyName.name, hierarchy.getName());
row.set(HierarchyUniqueName.name, hierarchy.getUniqueName());
//row.set(HierarchyGuid.name, "");
row.set(HierarchyCaption.name, hierarchy.getCaption());
row.set(DimensionType.name, getDimensionType(dimension));
// The number of members in the hierarchy. Because
// of the presence of multiple hierarchies, this number
// might not be the same as DIMENSION_CARDINALITY. This
// value can be an approximation of the real
// cardinality. Consumers should not assume that this
// value is accurate.
int cardinality =
RolapMember.getHierarchyCardinality(schemaReader, hierarchy);
row.set(HierarchyCardinality.name, cardinality);
row.set(DefaultMember.name, hierarchy.getDefaultMember());
if (hierarchy.hasAll()) {
row.set(
AllMember.name,
Util.makeFqName(hierarchy, hierarchy.getAllMemberName()));
}
row.set(Description.name, desc);
//TODO: only support:
// MD_STRUCTURE_FULLYBALANCED (0)
// MD_STRUCTURE_RAGGEDBALANCED (1)
row.set(Structure.name, hierarchy.isRagged() ? 1 : 0);
row.set(IsVirtual.name, false);
row.set(IsReadWrite.name, false);
// NOTE that SQL Server returns '0' not '1'.
row.set(DimensionUniqueSettings.name, 0);
// always true
row.set(DimensionIsVisible.name, true);
row.set(HierarchyOrdinal.name, ordinal);
// always true
row.set(DimensionIsShared.name, true);
RolapLevel nonAllFirstLevel =
(RolapLevel) hierarchy.getLevels()[
(hierarchy.hasAll() ? 1 : 0)];
row.set(ParentChild.name, nonAllFirstLevel.isParentChild());
addRow(row, rows);
}
示例9: outputMember
import mondrian.rolap.RolapMember; //导入依赖的package包/类
private void outputMember(
final SchemaReader schemaReader,
Member member,
final String catalogName,
Cube cube,
List<Row> rows)
{
// Access control
if (!canAccess(schemaReader, member)) {
return;
}
if (! memberNameRT.passes(member.getName())) {
return;
}
if (! memberTypeRT.passes(member.getMemberType())) {
return;
}
if (member.getOrdinal() == -1) {
RolapMember.setOrdinals(schemaReader, member);
}
// Check whether the member is visible, otherwise do not dump.
Boolean visible =
(Boolean) member.getPropertyValue(Property.VISIBLE.name);
if (visible == null) {
visible = true;
}
if (!EMIT_INVISIBLE_MEMBERS && !visible) {
return;
}
final Level level = member.getLevel();
final Hierarchy hierarchy = level.getHierarchy();
final Dimension dimension = hierarchy.getDimension();
int adjustedLevelDepth = level.getDepth();
Role.HierarchyAccess hierarchyAccess =
schemaReader.getRole().getAccessDetails(hierarchy);
if (hierarchyAccess != null) {
adjustedLevelDepth -= hierarchyAccess.getTopLevelDepth();
}
Row row = new Row();
row.set(CatalogName.name, catalogName);
row.set(SchemaName.name, cube.getSchema().getName());
row.set(CubeName.name, cube.getName());
row.set(DimensionUniqueName.name, dimension.getUniqueName());
row.set(HierarchyUniqueName.name, hierarchy.getUniqueName());
row.set(LevelUniqueName.name, level.getUniqueName());
row.set(LevelNumber.name, adjustedLevelDepth);
row.set(MemberOrdinal.name, false ? 0 : member.getOrdinal());
row.set(MemberName.name, member.getName());
row.set(MemberUniqueName.name, member.getUniqueName());
row.set(MemberType.name, member.getMemberType().ordinal());
//row.set(MemberGuid.name, "");
row.set(MemberCaption.name, member.getCaption());
row.set(
ChildrenCardinality.name,
member.getPropertyValue(Property.CHILDREN_CARDINALITY.name));
row.set(ChildrenCardinality.name, 100);
if (adjustedLevelDepth == 0) {
row.set(ParentLevel.name, 0);
} else {
row.set(ParentLevel.name, adjustedLevelDepth - 1);
String parentUniqueName = member.getParentUniqueName();
if (parentUniqueName != null) {
row.set(ParentUniqueName.name, parentUniqueName);
}
}
row.set(ParentCount.name, member.getParentMember() == null ? 0 : 1);
row.set(Depth.name, member.getDepth());
addRow(row, rows);
}
示例10: MemberColumnPredicate
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* Creates a MemberColumnPredicate
*
* @param column Constrained column
* @param member Member to constrain column to; must not be null
*/
public MemberColumnPredicate(RolapStar.Column column, RolapMember member) {
super(column, member.getKey());
this.member = member;
}
示例11: getMember
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* Returns the <code>Member</code>.
*
* @return Returns the <code>Member</code>, not null.
*/
public RolapMember getMember() {
return member;
}
示例12: getMemberChildrenConstraint
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* When the members of a level are fetched, the result is grouped
* by into parents and their children. These parent/children are
* stored in the parent/children cache, whose key consists of the parent
* and the MemberChildrenConstraint#hashKey(). So we need a matching
* MemberChildrenConstraint to store the parent with its children into
* the parent/children cache.
*
* <p>The returned MemberChildrenConstraint must be one that would have
* returned the same children for the given parent as the MemberLevel query
* has found for that parent.
*
* <p>If null is returned, the parent/children will not be cached (but the
* level/members still will be).
*/
MemberChildrenConstraint getMemberChildrenConstraint(RolapMember parent);
示例13: addMemberConstraint
import mondrian.rolap.RolapMember; //导入依赖的package包/类
/**
* Modifies a <code>Member.Children</code> query so that only the children
* of <code>parent</code> will be returned in the result set.
*
* @param sqlQuery the query to modify
* @param baseCube base cube for virtual members
* @param aggStar Aggregate star, if we are reading from an aggregate table,
* @param parent the parent member that restricts the returned children
*/
public void addMemberConstraint(
SqlQuery sqlQuery,
RolapCube baseCube,
AggStar aggStar,
RolapMember parent);