Add adds the specified node to the list of children and sets its parent pointer. If the specified node had a parent, the specified node is removed from the original parent's list of children.
(ichild INode)
| 309 | // Add adds the specified node to the list of children and sets its parent pointer. |
| 310 | // If the specified node had a parent, the specified node is removed from the original parent's list of children. |
| 311 | func (n *Node) Add(ichild INode) *Node { |
| 312 | |
| 313 | setParent(n.GetINode(), ichild) |
| 314 | n.children = append(n.children, ichild) |
| 315 | n.Dispatch(OnDescendant, nil) |
| 316 | return n |
| 317 | } |
| 318 | |
| 319 | // AddAt adds the specified node to the list of children at the specified index and sets its parent pointer. |
| 320 | // If the specified node had a parent, the specified node is removed from the original parent's list of children. |
no test coverage detected