outputMember(connection, member, catalog, cube, rows);
}
// Visit node's siblings (not including itself).
if (mask(treeOp, TreeOp.SIBLINGS.xmlaOrdinal())) {
final List<Member> siblings;
final Member parent = member.getParentMember();
if (parent == null) {
siblings = member.getHierarchy().getRootMembers();
} else {
siblings = Olap4jUtil.cast(parent.getChildMembers());
}
for (Member sibling : siblings) {
if (sibling.equals(member)) {
continue;
}
populateMember(
connection, catalog,
cube, sibling,
TreeOp.SELF.xmlaOrdinal(), rows);
}
}
// Visit node's descendants or its immediate children, but not both.
if (mask(treeOp, TreeOp.DESCENDANTS.xmlaOrdinal())) {
for (Member child : member.getChildMembers()) {
populateMember(
connection, catalog,
cube, child,
TreeOp.SELF.xmlaOrdinal() |
TreeOp.DESCENDANTS.xmlaOrdinal(),
rows);
}
} else if (mask(
treeOp, TreeOp.CHILDREN.xmlaOrdinal()))
{
for (Member child : member.getChildMembers()) {
populateMember(
connection, catalog,
cube, child,
TreeOp.SELF.xmlaOrdinal(), rows);
}
}
// Visit node's ancestors or its immediate parent, but not both.
if (mask(treeOp, TreeOp.ANCESTORS.xmlaOrdinal())) {
final Member parent = member.getParentMember();
if (parent != null) {
populateMember(
connection, catalog,
cube, parent,
TreeOp.SELF.xmlaOrdinal() |
TreeOp.ANCESTORS.xmlaOrdinal(), rows);
}
} else if (mask(treeOp, TreeOp.PARENT.xmlaOrdinal())) {
final Member parent = member.getParentMember();
if (parent != null) {
populateMember(
connection, catalog,
cube, parent,
TreeOp.SELF.xmlaOrdinal(), rows);