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;
}
Aggregations