Adds a child. The child can be both {@link Item}s or another {@link Tree}s.
549061
public void addChild(Item child) {
        if (children == null) {
            children = new ArrayList<>();
        }

        children.add(child);
    }
18595
public void addChild(int offset, TreeElement child)
            throws IllegalArgumentException
    {
        child.setSelected(false);
        child.setParent(this);
        if (_children == null)
            _children = new ArrayList();
        _children.add(offset, child);

        //Need to rename all affected!
        int size = _children.size();
        for (int i = offset; i < size; i++) {
            TreeElement thisChild = (TreeElement) _children.get(i);
            thisChild.updateName(this, i);
        }

    }
1350470
public void addChild(C child) {
        SharedPreferences prefs = loadSharedPreferences("children");

        List<String> objects = getChildrenList();

        Model toPut = (Model) child;

        if (objects.indexOf(toPut.getId()) != ArrayUtils.INDEX_NOT_FOUND) {
            return;
        }

        objects.add(toPut.getId());

        toPut.save();

        prefs.edit().putString(String.valueOf(getId()), StringUtils.join(objects, ",")).commit();
    }
1250024
def add_child_to_self( self, tree ):
        '''  '''
        assert isinstance(tree, Tree), \
               '(!) Unexpected type of argument for '+argName+'! Should be Tree.'
        if (not self.children):
            self.children = []
        tree.parent = self
        self.children.append(tree)
487338
def addchild(self, child):
        
        if not self.accept_children:
            return False
        self.children += [child]
        return True
1323658
@Override
	public void addChild(final ITreeNode<T> child)
	{
		if (children != null)
		{
			children.add(child);
		}
		else
		{
			children = new ArrayList<>();
			children.add(child);
		}

	}
401381
public void addChildBefore(Node newChild, Node node) {
        if (newChild.next != null)
            throw new RuntimeException(
                      "newChild had siblings in addChildBefore");
        if (first == node) {
            newChild.next = first;
            first = newChild;
            return;
        }
        Node prev = getChildBefore(node);
        addChildAfter(newChild, prev);
    }
538671
public void addChild(final DiffNode node)
	{
		if (node == this)
		{
			throw new IllegalArgumentException("Detected attempt to add a node to itself. " +
					"This would cause inifite loops and must never happen.");
		}
		else if (node.isRootNode())
		{
			throw new IllegalArgumentException("Detected attempt to add root node as child. " +
					"This is not allowed and must be a mistake.");
		}
		else if (node.getParentNode() != null && node.getParentNode() != this)
		{
			throw new IllegalArgumentException("Detected attempt to add child node that is already the " +
					"child of another node. Adding nodes multiple times is not allowed, since it could " +
					"cause infinite loops.");
		}
		if (node.getParentNode() == null)
		{
			node.setParentNode(this);
		}
		children.put(node.getElementSelector(), node);
		if (state == State.UNTOUCHED && node.hasChanges())
		{
			state = State.CHANGED;
		}
	}
1152827
function addChild (getValue, newChild, tree) {
    tree.children.splice(
      binaryIndexBy(getValue, getValue(newChild), tree.children),
      0, newChild
    );

    return newChild;
  }
243336
public void addChildren(
        CmsTreeItem parent,
        List<CmsCategoryTreeEntry> children,
        Collection<String> selectedCategories) {

        if (children != null) {
            for (CmsCategoryTreeEntry child : children) {
                // set the category tree item and add to parent tree item
                CmsTreeItem treeItem = buildTreeItem(child, selectedCategories);
                m_childrens.get(parent.getId()).add(treeItem.getId());
                m_childrens.put(treeItem.getId(), new ArrayList<>(child.getChildren().size()));
                if ((selectedCategories != null) && selectedCategories.contains(child.getPath())) {
                    openWithParents(parent);

                }
                if (m_isSingleSelection) {
                    if (treeItem.getCheckBox().isChecked()) {
                        parent.getCheckBox().setChecked(false);
                    }
                }
                parent.addChild(treeItem);
                addChildren(treeItem, child.getChildren(), selectedCategories);
            }
        }
    }
759440
public void addFirstChild( AstNode child ) {
        assert child != null;
        this.children.addFirst(child);
        child.removeFromParent();
        child.parent = this;
    }
580133
public void addChildren( AstNode first,
                             AstNode second ) {
        if (first != null) {
            this.addLastChild(first);
        }
        if (second != null) {
            this.addLastChild(second);
        }
    }
302691
public void addChild(CmsGalleryTreeEntry child) {

        if (m_children == null) {
            m_children = new ArrayList<CmsGalleryTreeEntry>();
        }
        m_children.add(child);
        child.setParent(this);
    }
1019447
def child_added(self, child):
        
        super(AbstractItemView, self).child_added(child)
        self.get_member('_items').reset(self)
962703
public static <T extends MutableTreeNode<T>> void addChild(T parent, T child) {
        checkArgNotNull(parent, "parent");
        parent.addChild(parent.getChildren().size(), child);
    }
1217673
def add_children(self, *children, **kwargs):
        """"""
        for child in children:
            self.add_child(child, **kwargs)
334778
public XNElement add(XNElement child) {
        child.parent = this;
        children.add(child);
        return child;
    }