| Constructor and Description |
|---|
NodeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
add(Node parent,
Node node,
Node from,
Node to)
Adds
node and moves children specified by
from and to to it. |
static Node |
commonAncestor(org.w3c.dom.html.HTMLCollection ancestors)
Find common ancestor
Node of targets |
static Node |
commonAncestor(Node anc1,
Node anc2)
Find common ancestor
Node of targets |
static void |
remove(Node node)
Replaces
node with its children. |
public static Node commonAncestor(Node anc1, Node anc2)
Node of targetsanc1 - target Node 1anc2 - target Node 2Node or null if not availablepublic static void remove(Node node)
node with its children. The following is an
example:
R R
/ \ /|\
A B -> A E F
/ \
E F
remove B
node - target node.IllegalArgumentExceptionpublic static void add(Node parent, Node node, Node from, Node to)
node and moves children specified by
from and to to it. The following is an
example:
R R
/|\ / \
A E F -> A B
/ \
E F
add B ...
parent - target parent nodenode - target nodefrom - beginning of the children moved to node. If
null, no child will be moved.to - end of the children moved to nodeIllegalArgumentExceptionpublic static Node commonAncestor(org.w3c.dom.html.HTMLCollection ancestors)
Node of targets