当前位置: 首页>>代码示例>>Java>>正文


Java Member类代码示例

本文整理汇总了Java中mondrian.olap.Member的典型用法代码示例。如果您正苦于以下问题:Java Member类的具体用法?Java Member怎么用?Java Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Member类属于mondrian.olap包,在下文中一共展示了Member类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMember

import mondrian.olap.Member; //导入依赖的package包/类
public JRMondrianMember createMember(Member member)
{
	JRMondrianMember mondrianMember;
	if (member == null)
	{
		mondrianMember = null;
	}
	else
	{
		String key = member.getUniqueName();
		mondrianMember = members.get(key);
		if (mondrianMember == null)
		{
			mondrianMember = new JRMondrianMember(member, this);
			members.put(key, mondrianMember);
		}
	}
	return mondrianMember;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:JRMondrianFactory.java

示例2: toOlap4j

import mondrian.olap.Member; //导入依赖的package包/类
NamedList<MondrianOlap4jMember> toOlap4j(
    final List<Member> memberList)
{
    return new AbstractNamedList<MondrianOlap4jMember>() {
        public String getName(Object olap4jMember) {
            return ((MondrianOlap4jMember)olap4jMember).getName();
        }

        public MondrianOlap4jMember get(int index) {
            return toOlap4j(memberList.get(index));
        }

        public int size() {
            return memberList.size();
        }
    };
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:18,代码来源:MondrianOlap4jConnection.java

示例3: slice

import mondrian.olap.Member; //导入依赖的package包/类
public List<Member> slice(final int column) {
    if (column < 0 || column >= arity) {
        throw new IllegalArgumentException();
    }
    return new AbstractList<Member>() {
        @Override
        public Member get(int index) {
            return ListTupleList.this.get(column, index);
        }

        @Override
        public int size() {
            return ListTupleList.this.size();
        }
    };
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:17,代码来源:ListTupleList.java

示例4: testUnion

import mondrian.olap.Member; //导入依赖的package包/类
/**
 * Test for MONDRIAN-2250 issue.
 * Tuples are gotten from customer attachments.
 */
public void testUnion() {
        DelegatingTupleList delegatingTupleList1 = new DelegatingTupleList(
            4, new ArrayList<List<Member>>());
        String totalViewingTime = "[Measures].[Total Viewing Time]";
        fillDelegatingTupleLists(delegatingTupleList1, totalViewingTime);

        DelegatingTupleList delegatingTupleList2 = new DelegatingTupleList(
            4, new ArrayList<List<Member>>());
        String averageTimeshift = "[Measures].[Average Timeshift]";
        fillDelegatingTupleLists(delegatingTupleList2, averageTimeshift);

        UnionFunDef unionFunDefMock = Mockito.mock(UnionFunDef.class);
        doCallRealMethod().when(unionFunDefMock).union(
            any(TupleList.class), any(TupleList.class), anyBoolean());

        TupleList tupleList = unionFunDefMock.union(
            delegatingTupleList1, delegatingTupleList2, false);
        assertEquals(40, tupleList.size());
    }
 
开发者ID:OSBI,项目名称:mondrian,代码行数:24,代码来源:UnionFunDefTest.java

示例5: toString

import mondrian.olap.Member; //导入依赖的package包/类
public static String toString(List<Position> pl) {
    StringBuilder buf = new StringBuilder();
    for (Position p : pl) {
        buf.append('{');
        boolean firstTime = true;
        for (Member m : p) {
            if (! firstTime) {
                buf.append(", ");
            }
            buf.append(m.getUniqueName());
            firstTime = false;
        }
        buf.append('}');
        buf.append('\n');
    }
    return buf.toString();
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:18,代码来源:RolapAxis.java

示例6: iterator

import mondrian.olap.Member; //导入依赖的package包/类
public Iterator<Member> iterator() {
    return new Iterator<Member>() {
        public boolean hasNext() {
            return (member != null);
        }

        public Member next() {
            try {
                return member;
            } finally {
                member = null;
            }
        }

        public void remove() {
            throw new UnsupportedOperationException("remove");
        }
    };
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:RolapAxis.java

示例7: equals

import mondrian.olap.Member; //导入依赖的package包/类
public boolean equals(Object o) {
    if (o == this) {
        return true;
    }
    if (!(o instanceof List)) {
        return false;
    }
    List that = (List) o;
    final int size = this.size();
    if (size != that.size()) {
        return false;
    }
    for (int i = 0; i < size; i++) {
        final Member m1 = get(i);
        final Object m2 = that.get(i);
        if (!(m1 == null
            ? m2 == null
            : m1.equals(m2)))
        {
            return false;
        }
    }
    return true;
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:25,代码来源:RolapAxis.java

示例8: compileCall

import mondrian.olap.Member; //导入依赖的package包/类
public Calc compileCall(final ResolvedFunCall call, ExpCompiler compiler) {
    final MemberCalc[] memberCalcs =
        compileMembers(call.getArg(0), call.getArg(1), compiler);
    return new AbstractListCalc(
        call, new Calc[] {memberCalcs[0], memberCalcs[1]})
        {
        public List evaluateList(Evaluator evaluator) {
            final Member member0 = memberCalcs[0].evaluateMember(evaluator);
            final Member member1 = memberCalcs[1].evaluateMember(evaluator);
            if (member0.isNull() || member1.isNull()) {
                return Collections.EMPTY_LIST;
            }
            if (member0.getLevel() != member1.getLevel()) {
                throw evaluator.newEvalException(
                    call.getFunDef(),
                    "Members must belong to the same level");
            }
            return FunUtil.memberRange(evaluator, member0, member1);
        }
    };
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:22,代码来源:RangeFunDef.java

示例9: hashCode

import mondrian.olap.Member; //导入依赖的package包/类
public int hashCode() {
    if (mObject instanceof Member) {
        return mObject.hashCode();
    } else if (mObject instanceof Member[]) {
        int hash = 0;

        Member[] array = (Member[]) mObject;

        for (int idx = 0; idx < array.length; idx++) {
            hash ^= array[idx].hashCode();
        }

        return hash;
    } else {
        return mObject.hashCode();
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:18,代码来源:MemberHelper.java

示例10: executeSingletonAxis

import mondrian.olap.Member; //导入依赖的package包/类
/**
 * Executes a set expression which is expected to return 0 or 1 members.
 * It is an error if the expression returns tuples (as opposed to members),
 * or if it returns two or more members.
 *
 * @param expression Expression string
 * @return Null if axis returns the empty set, member if axis returns one
 *   member. Throws otherwise.
 */
public Member executeSingletonAxis(String expression) {
    final String cubeName = getDefaultCubeName();
    Result result = executeQuery(
            "select {" + expression + "} on columns from " + cubeName);
    Axis axis = result.getAxes()[0];
    switch (axis.getPositions().size()) {
    case 0:
        // The mdx "{...}" operator eliminates null members (that is,
        // members for which member.isNull() is true). So if "expression"
        // yielded just the null member, the array will be empty.
        return null;
    case 1:
        // Java nulls should never happen during expression evaluation.
        Position position = axis.getPositions().get(0);
        Util.assertTrue(position.size() == 1);
        Member member = position.get(0);
        Util.assertTrue(member != null);
        return member;
    default:
        throw Util.newInternal(
            "expression " + expression
            + " yielded " + axis.getPositions().size() + " positions");
    }
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:34,代码来源:TestContext.java

示例11: toString

import mondrian.olap.Member; //导入依赖的package包/类
/**
 * Converts a set of positions into a string. Useful if you want to check
 * that an axis has the results you expected.
 */
public static String toString(List<Position> positions) {
    StringBuilder buf = new StringBuilder();
    int i = 0;
    for (Position position : positions) {
        if (i > 0) {
            buf.append(nl);
        }
        if (position.size() != 1) {
            buf.append("{");
        }
        for (int j = 0; j < position.size(); j++) {
            Member member = position.get(j);
            if (j > 0) {
                buf.append(", ");
            }
            buf.append(member.getUniqueName());
        }
        if (position.size() != 1) {
            buf.append("}");
        }
        i++;
    }
    return buf.toString();
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:29,代码来源:TestContext.java

示例12: checkDrillThroughSql

import mondrian.olap.Member; //导入依赖的package包/类
private void checkDrillThroughSql(
    Result result,
    int row,
    boolean extendedContext,
    String expectedMember,
    String expectedCell,
    String expectedSql,
    int expectedRows) throws Exception
{
    final Member empMember =
        result.getAxes()[1].getPositions().get(row).get(0);
    assertEquals(expectedMember, empMember.getUniqueName());
    // drill through member
    final Cell cell = result.getCell(new int[]{0, row});
    assertEquals(expectedCell, cell.getFormattedValue());
    String sql = cell.getDrillThroughSQL(extendedContext);

    getTestContext().assertSqlEquals(expectedSql, sql, expectedRows);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:20,代码来源:ParentChildHierarchyTest.java

示例13: JRMondrianTuple

import mondrian.olap.Member; //导入依赖的package包/类
public JRMondrianTuple(Position position, JRMondrianFactory factory)
{
	members = new JRMondrianMember[position.size()];
	int idx = 0;
	for (Iterator<Member> it = position.iterator(); it.hasNext(); ++idx)
	{
		Member member = it.next();
		members[idx] = factory.createMember(member);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:JRMondrianTuple.java

示例14: getMemberChildren

import mondrian.olap.Member; //导入依赖的package包/类
public Map<? extends Member, Access> getMemberChildren(
    RolapMember parentMember,
    List<RolapMember> children,
    MemberChildrenConstraint constraint)
{
    List<RolapMember> parentMembers =
        Collections.singletonList(parentMember);
    return getMemberChildren(parentMembers, children, constraint);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:10,代码来源:SmartMemberReader.java

示例15: getMemberChildren

import mondrian.olap.Member; //导入依赖的package包/类
public Map<? extends Member, Access> getMemberChildren(
    RolapMember parentMember,
    List<RolapMember> children,
    MemberChildrenConstraint constraint)
{
    return memberReader.getMemberChildren(
        parentMember, children, constraint);
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:9,代码来源:DelegatingMemberReader.java


注:本文中的mondrian.olap.Member类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。