Search in sources :

Example 1 with AbstractNamedList

use of org.olap4j.impl.AbstractNamedList in project mondrian by pentaho.

the class MondrianOlap4jMember method getChildMembers.

public NamedList<MondrianOlap4jMember> getChildMembers() throws OlapException {
    final RolapConnection conn = olap4jSchema.olap4jCatalog.olap4jDatabaseMetaData.olap4jConnection.getMondrianConnection();
    final List<mondrian.olap.Member> children = Locus.execute(conn, "MondrianOlap4jMember.getChildMembers", new Locus.Action<List<mondrian.olap.Member>>() {

        public List<mondrian.olap.Member> execute() {
            return conn.getSchemaReader().getMemberChildren(member);
        }
    });
    return new AbstractNamedList<MondrianOlap4jMember>() {

        public String getName(Object member) {
            return ((MondrianOlap4jMember) member).getName();
        }

        public MondrianOlap4jMember get(int index) {
            return new MondrianOlap4jMember(olap4jSchema, children.get(index));
        }

        public int size() {
            return children.size();
        }
    };
}
Also used : RolapConnection(mondrian.rolap.RolapConnection) List(java.util.List) AbstractNamedList(org.olap4j.impl.AbstractNamedList) ArrayList(java.util.ArrayList) Locus(mondrian.server.Locus) AbstractNamedList(org.olap4j.impl.AbstractNamedList)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 RolapConnection (mondrian.rolap.RolapConnection)1 Locus (mondrian.server.Locus)1 AbstractNamedList (org.olap4j.impl.AbstractNamedList)1