Search in sources :

Example 1 with ConcatenableList

use of mondrian.util.ConcatenableList in project mondrian by pentaho.

the class Util method addLevelCalculatedMembers.

public static List<Member> addLevelCalculatedMembers(SchemaReader reader, Level level, List<Member> members) {
    List<Member> calcMembers = reader.getCalculatedMembers(level.getHierarchy());
    List<Member> calcMembersInThisLevel = new ArrayList<Member>();
    for (Member calcMember : calcMembers) {
        if (calcMember.getLevel().equals(level)) {
            calcMembersInThisLevel.add(calcMember);
        }
    }
    if (!calcMembersInThisLevel.isEmpty()) {
        List<Member> newMemberList = new ConcatenableList<Member>();
        newMemberList.addAll(members);
        newMemberList.addAll(calcMembersInThisLevel);
        return newMemberList;
    }
    return members;
}
Also used : ArrayList(java.util.ArrayList) ConcatenableList(mondrian.util.ConcatenableList) RolapMember(mondrian.rolap.RolapMember)

Aggregations

ArrayList (java.util.ArrayList)1 RolapMember (mondrian.rolap.RolapMember)1 ConcatenableList (mondrian.util.ConcatenableList)1