/** * Remove child from children list * * @param child */ public void remove(Node child) { childrenList.remove(child); child.setParent(null); }
/** * Add one child and set child's parent to current node * * @param node new child */ public void addNode(Node node) { childrenList.add(node); node.setParent(this); }
/** * Remove child at childIndex * * @param childIndex child indexs */ public void remove(int childIndex) { Node child = getChildAt(childIndex); childrenList.remove(childIndex); child.setParent(null); }