# Class ParentNode

java.lang.Object
nu.validator.saxtree.Node
nu.validator.saxtree.ParentNode

All Implemented Interfaces:
  `Locator2, Locator`

Direct Known Subclasses:
  `CDATA, Document, DocumentFragment, DTD, Element, Entity`

public abstract class ParentNode extends Node
Common superclass for parent nodes.

Version:
  $Id$
Author:
  hsivonen

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Locator`
`endLocator`
The end locator.

## Method Summary

Modifier and Type
Method
Description
`Node`
`appendChild(Node child)`
Append a child to this node and return the child.
`void`
`appendChildren(Node parent)`
Append the children of another node to this node removing them from the other node .
`void`
`clearChildren()`
Remove all children from this node.
`void`
`copyEndLocator(ParentNode another)`
Copies the endLocator from another node.
`final Node`
`getFirstChild()`
Returns the firstChild.
`final Node`
`getLastChild()`
Returns the lastChild.
`Node`
`insertBefore(Node child, Node sibling)`
Insert a new child before a pre-existing child and return the newly inserted child.
`Node`
`insertBetween(Node child, Node prev, Node next)`
`void`
`setEndLocator(Locator endLocator)`
Sets the endLocator.

### Methods inherited from class Node

`detach, getAttributes, getColumnNumber, getData, getEncoding, getLineNumber, getLocalName, getName, getNextSibling, getNodeType, getParentNode, getPrefixMappings, getPreviousSibling, getPublicId, getPublicIdentifier, getQName, getSystemId, getSystemIdentifier, getTarget, getUri, getXMLVersion`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### endLocator

protected Locator endLocator
The end locator.

## Method Details

### setEndLocator

public void setEndLocator(Locator endLocator)
Sets the endLocator.

Parameters:
  `endLocator` - the endLocator to set

### copyEndLocator

public void copyEndLocator(ParentNode another)
Copies the endLocator from another node.

Parameters:
  `another` - the another node

### getFirstChild

public final Node getFirstChild()
Returns the firstChild.

Overrides:
  `getFirstChild` in class `Node`
Returns:
  the firstChild

### getLastChild

public final Node getLastChild()
Returns the lastChild.

Returns:
  the lastChild

### insertBefore

public Node insertBefore(Node child, Node sibling)
Insert a new child before a pre-existing child and return the newly inserted child.

Parameters:
  `child` - the new child
  `sibling` - the existing child before which to insert (must be a child of this node) or `null` to append
Returns:
  `child`

### insertBetween

public Node insertBetween(Node child, Node prev, Node next)

### appendChild

public Node appendChild(Node child)
Append a child to this node and return the child.

Parameters:
  `child` - the child to append.
Returns:
  `child`

### appendChildren

public void appendChildren(Node parent)
Append the children of another node to this node removing them from the other node .

Parameters:
  `parent` - the other node whose children to append to this one

### clearChildren

public void clearChildren()
Remove all children from this node.