public JROlapMember ancestorMatch(JROlapMember member) { JROlapMember ancestor; int memberDepth = member.getDepth(); if (depth == null) { ancestor = member; } else if (depth.getDepth() <= memberDepth) { ancestor = member; for (int i = depth.getDepth(); i < memberDepth && ancestor != null; ++i) { ancestor = ancestor.getParentMember(); } } else { ancestor = null; } return ancestor; }
public boolean matches(JROlapMember member) { boolean match; int memberDepth = member.getDepth(); if (depth == null) { match = true; } else { match = memberDepth == depth.getDepth(); } return match; }