The generic superclass for nodes that have children. Not counting subclasses, there are exactly two such public classes in XOM:
DocumentElementThis class provides methods to add and remove child nodes.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv String | |
| pack-priv int | |
| pack-priv Node[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | |
| public void | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv final String | |
| pack-priv String | |
| public Node | Returns: the node at the requested positionindex of the node to return position)Implements abstract nu. Returns the child of this node at the specified position. |
| public int | Returns: the number of children of this nodeImplements abstract nu. Returns the number of child nodes this node contains. |
| public int | |
| public void | insertChild(Node
the node to insert child, int where to insert the child position)Inserts a child node at the specified position. |
| pack-priv abstract void | |
| public Node | Returns: the node which was removedindex of the node to remove position)Removes the child of this node at the specified position. |
| public Node | Returns: the node which was removedchild node to remove child)Removes the specified child of this node. |
| public void | replaceChild(Node
the node removed from the tree oldChild, Node the node inserted into the tree newChild)Replaces an existing child with a new child node. |
| pack-priv void | |
| public abstract void | setBaseURI(String
the new base URI for this node URI)Sets the URI against which relative URIs in this node will be resolved. |
| actualBaseURI | back to summary |
|---|---|
| pack-priv String actualBaseURI | |
| childCount | back to summary |
|---|---|
| pack-priv int childCount | |
| children | back to summary |
|---|---|
| pack-priv Node[] children | |
| ParentNode | back to summary |
|---|---|
| pack-priv ParentNode()
Creates a new | |
| _insertChild | back to summary |
|---|---|
| pack-priv final void _insertChild(Node child, int position) | |
| appendChild | back to summary |
|---|---|
| public void appendChild(Node child) Appends a node to the children of this node.
| |
| checkCapacity | back to summary |
|---|---|
| private void checkCapacity(int position) | |
| fastInsertChild | back to summary |
|---|---|
| pack-priv void fastInsertChild(Node child, int position) | |
| fillInBaseURI | back to summary |
|---|---|
| pack-priv void fillInBaseURI(Element removed) | |
| findActualBaseURI | back to summary |
|---|---|
| pack-priv final String findActualBaseURI() | |
| getActualBaseURI | back to summary |
|---|---|
| pack-priv String getActualBaseURI() | |
| getChild | back to summary |
|---|---|
| public Node getChild(int position) Implements abstract nu. Returns the child of this node at the specified position. Indexes begin at 0 and count up to one less than the number of children in this node.
| |
| getChildCount | back to summary |
|---|---|
| public int getChildCount() Implements abstract nu. Returns the number of child nodes this node contains. This is always greater than or equal to 0.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(Node child)
Returns the position of a node within the children of this
node. This is a number between 0 and one less than the number of
children of this node. It returns -1 if This method does a linear search through the node's children. On average, it executes in O(N) where N is the number of children of the node.
| |
| insertChild | back to summary |
|---|---|
| public void insertChild(Node child, int position)
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
All the other methods that add a node to the tree ultimately invoke this method.
| |
| insertionAllowed | back to summary |
|---|---|
| pack-priv abstract void insertionAllowed(Node child, int position) | |
| removeChild | back to summary |
|---|---|
| public Node removeChild(int position) Removes the child of this node at the specified position. Indexes begin at 0 and count up to one less than the number of children in this node.
| |
| removeChild | back to summary |
|---|---|
| public Node removeChild(Node child) Removes the specified child of this node.
| |
| replaceChild | back to summary |
|---|---|
| public void replaceChild(Node oldChild, Node newChild)
Replaces an existing child with a new child node.
If
| |
| setActualBaseURI | back to summary |
|---|---|
| pack-priv void setActualBaseURI(String uri) | |
| setBaseURI | back to summary |
|---|---|
| public abstract void setBaseURI(String URI) Sets the URI against which relative URIs in this node will be resolved. Generally, it's only necessary to set this property if it's different from a node's parent's base URI, as it may be in a document assembled from multiple entities or by XInclude. Relative URIs are not allowed here. Base URIs must be absolute. However, the base URI may be set to null or the empty string to indicate that the node has no explicit base URI. In this case, it inherits the base URI of its parent node, if any. URIs with fragment identifiers are also not allowed. The value passed to this method must be a pure URI, not a URI reference.
You can also add an
If the base URI is null or the empty string and there is
no
| |