public void addChild(GenericTreeNode<T> child) { child.parent = this; children.add(child); }
public void addChildAt(int index, GenericTreeNode<T> child) throws IndexOutOfBoundsException { child.parent = this; children.add(index, child); }
public void setChildren(List<GenericTreeNode<T>> children) { for (GenericTreeNode<T> child : children) { child.parent = this; } this.children = children; }