protected LdapTreeNode[] getPathToRoot(LdapTreeNode node, int depth) { LdapTreeNode[] retNodes; if (node == null) { if (depth == 0) return null; else retNodes = new LdapTreeNode[depth]; } else { depth++; retNodes = getPathToRoot(node.getParent(), depth); retNodes[retNodes.length - depth] = node; } return retNodes; }
public void addChild(LdapTreeNode child) { children.add(child); child.setParent(this); }