/** * Appends a child node at the given index * * @param index insert point * @param child node to be appended * @return the node */ public Sup appendChild(int index, Node child) { if (this == child) { throw new Error("Cannot append a node to itself."); } child.setParent(this); children.add(index, child); return this; }
/** * Appends a child node to the end of this element's DOM tree * * @param child node to be appended * @return the node */ public Frameset appendChild(Node child) { if (this == child) { throw new Error("Cannot append a node to itself."); } child.setParent(this); children.add(child); return this; }