method to add child tag to this {@link CompoundTag}, updates the size on add

@param ch
- child {@link Tag} to be added
@return - this for chaining
966664
public CompoundTag add(Tag ch) {
        subElements.put(ch.getName(), ch);
        long sz = getSize() + ch.totalSize();
        byte length = 1;
        long v = (sz + 1) >> BIT_IN_BYTE;
        while (v > 0) {
            length++;
            v = v >> BIT_IN_BYTE;
        }
        size = new VINT(0L, length, sz);
        return this;
    }
1244201
protected void addChild(LazyNode token){
		// If no children have been added yet, lastChild will be null
		if(lastChild==null){
			child=token;
			lastChild=token;
			return;
		}
		// Set the next pointer on the current end of the child list and set last child to the given token
		lastChild.next=token;
		lastChild=token;
	}
1298785
@SuppressWarnings("unchecked")
    public T addTags(List<String> tags) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.addAll(tags);
        return (T) this;
    }
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
525358
public void append(char c) {
        if (this.length + 1 > this.ch.length) {
                    int newLength = this.ch.length*2;
                    if (newLength < this.ch.length + DEFAULT_SIZE)
                        newLength = this.ch.length + DEFAULT_SIZE;
                    char[] newch = new char[newLength];
                    System.arraycopy(this.ch, 0, newch, 0, this.length);
                    this.ch = newch;
        }
        this.ch[this.length] = c;
        this.length++;
    }
1273213
public void addTag(String tag) {
        if (this.tags == null) {
            tags = new ArrayList<String>();
        }
        this.tags.add(tag);
    }
366593
def add_child(parent, tag, text=None):
    
    elem = ET.SubElement(parent, tag)
    if text is not None:
        elem.text = text
    return elem
185539
@Override
    public StrBuilder append(final char ch) {
        final int len = length();
        ensureCapacity(len + 1);
        buffer[size++] = ch;
        return this;
    }
1286117
public T load(CompoundTag tag) {
        Tag subTag = tag.getValue().get(key);
        if (subTag == null) {
            return (value = defaultValue);
        }
        return (value = field.getValue(subTag));
    }
735682
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "compoundCRSRef")
    public JAXBElement<CompoundCRSRefType> createCompoundCRSRef(CompoundCRSRefType value) {
        return new JAXBElement<CompoundCRSRefType>(_CompoundCRSRef_QNAME, CompoundCRSRefType.class, null, value);
    }
1165551
public synchronized boolean addChild(Node child) {
    if (child.parent != null) {
      throw new IllegalArgumentException(
          "The child is already under another node:" + child.parent);
    }
    checkChildren();
    boolean retval = children.add(child);
    if (retval) child.parent = this;
    return retval;
  }
542493
public void appendChild(final Node child) {
        if (child instanceof Level) {
            // Append the level
            levels.add((Level) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else if (child instanceof SpecTopic) {
            appendSpecTopic((SpecTopic) child);
        } else if (child instanceof CommonContent) {
            // Append the common content
            commonContents.add((CommonContent) child);
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        } else {
            nodes.add(child);
            if (child.getParent() != null) {
                child.removeParent();
            }
            child.setParent(this);
        }
    }
67833
private void addChildElements() {
		for (Node node : nodes) {
			Collection<? extends Node> childNodes = helper.getChildNodes(node);
			for (Node child : childNodes)
				if (matchTag(child))
					result.add(child);
		}
	}
1004542
public final boolean addChild(int index, N newChild) {
		if (newChild == null) {
			return false;
		}

		final int count = (this.children == null) ? 0 : this.children.size();

		final N oldParent = newChild.getParentNode();
		if (oldParent != this && oldParent != null) {
			newChild.removeFromParent();
		}

		final int insertionIndex;

		if (this.children == null) {
			this.children = newInternalList(index + 1);
		}

		if (index < count) {
			// set the element
			insertionIndex = Math.max(index, 0);
			this.children.add(insertionIndex, newChild);
		} else {
			// Resize the array
			insertionIndex = this.children.size();
			this.children.add(newChild);
		}

		++this.notNullChildCount;

		newChild.setParentNodeReference(toN(), true);
		firePropertyChildAdded(insertionIndex, newChild);

		return true;
	}
915
public void addHeaderEntry( final Tag tag, final String value) {
	    format.getHeader().createEntry(tag, value);
	}
1047459
public void addTag(Tag tag) {
    set(PackageMetadata.TAGS, concat(getTags(), singletonList(tag)));
  }
647194
def add(self, child):
        

        if isinstance(child, Parameter):
            self.add_parameter(child)
        elif isinstance(child, Property):
            self.add_property(child)
        elif isinstance(child, DerivedParameter):
            self.add_derived_parameter(child)
        elif isinstance(child, IndexParameter):
            self.add_index_parameter(child)
        elif isinstance(child, Constant):
            self.add_constant(child)
        elif isinstance(child, Exposure):
            self.add_exposure(child)
        elif isinstance(child, Requirement):
            self.add_requirement(child)
        elif isinstance(child, ComponentRequirement):
            self.add_component_requirement(child)
        elif isinstance(child, InstanceRequirement):
            self.add_instance_requirement(child)
        elif isinstance(child, Children):
            self.add_children(child)
        elif isinstance(child, Text):
            self.add_text(child)
        elif isinstance(child, Link):
            self.add_link(child)
        elif isinstance(child, Path):
            self.add_path(child)
        elif isinstance(child, EventPort):
            self.add_event_port(child)
        elif isinstance(child, ComponentReference):
            self.add_component_reference(child)
        elif isinstance(child, Attachments):
            self.add_attachments(child)
        else:
            raise ModelError('Unsupported child element')