addSeveralBefore

fun Node.addSeveralBefore(targetNode: Node, newNodes: List<Node>)

Looks for targetNode in the lists of nodes in this node. When found, newNodes are inserted before it. When not found, an IllegalStateException is thrown.


fun Node.addSeveralBefore(newNodes: List<Node>)

Inserts the newNodes before this node if it is in a MutableList. For this to work, Node.assignParents must have been called.


fun <T> MutableList<T>.addSeveralBefore(index: Int, additions: List<T>)

Replaces the element at index with additions.