예제 #1
0
  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;
  }
예제 #2
0
 public void addChild(LdapTreeNode child) {
   children.add(child);
   child.setParent(this);
 }