Пример #1
0
 public void addChild(GenericTreeNode<T> child) {
   child.parent = this;
   children.add(child);
 }
Пример #2
0
 public void addChildAt(int index, GenericTreeNode<T> child) throws IndexOutOfBoundsException {
   child.parent = this;
   children.add(index, child);
 }
Пример #3
0
 public void setChildren(List<GenericTreeNode<T>> children) {
   for (GenericTreeNode<T> child : children) {
     child.parent = this;
   }
   this.children = children;
 }