Adopts (accepts as direct child) the provided node. @param child The node to adopt @return The child parameter for chaining. @throws IllegalStateException If child already has a parent (clone or unparent it first).
(AbstractNode child)
| 78 | * @throws IllegalStateException If {@code child} already has a parent (clone or unparent it first). |
| 79 | */ |
| 80 | protected AbstractNode adopt(AbstractNode child) throws IllegalStateException { |
| 81 | child.ensureParentless(); |
| 82 | child.parent = this; |
| 83 | return child; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Checks if this node is currently parentless. |
no test coverage detected