Converts a string to a text node and inserts that node at the specified position.
@param position where to insert the child @param text the string to convert to a text node and insert @throws NullPointerException if text is null @throws IndexOutOfBoundsException if the position is negativeor greater than the number of children of the node Inserts a child node at the specified position. The child node previously at that position (if any) and all subsequent child nodes are moved up by one. That is, when inserting a node at 2, the old node at 2 is moved to 3, the old child at 3 is moved to 4, and so forth. Inserting at position 0 makes the child the first child of this node. Inserting at the position getChildCount()
makes the child the last child of the node.
All the other methods that add a node to the tree ultimately invoke this method.
@param position where to insert the child @param child the node to insert @throws IllegalAddException if this node cannot have a child ofthe argument's type @throws MultipleParentException ifchild
already has a parent
@throws NullPointerException if child
is null
@throws IndexOutOfBoundsException if the position is negative or greater than the number of children of this node
If the given index {@code n} is out of range for this {@link XMLNode} instance,the {@code node} is added at the end of the list of children. Even inthat situation, this method does not throw an error.
@param n an integer, the index at which the given node is inserted @param node an {@link XMLNode} to be inserted as {@code n}th child.
@return a reference to the newly-inserted child {@code node}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|