Returns true if this node is an ancestor of the specified node. @param node the node to check @return true if this node is an ancestor of the specified node
(final DomNode node)
| 337 | * @return {@code true} if this node is an ancestor of the specified node |
| 338 | */ |
| 339 | public boolean isAncestorOf(final DomNode node) { |
| 340 | DomNode parent = node; |
| 341 | while (parent != null) { |
| 342 | if (parent == this) { |
| 343 | return true; |
| 344 | } |
| 345 | parent = parent.getParentNode(); |
| 346 | } |
| 347 | return false; |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Returns {@code true} if this node is an ancestor of the specified nodes. |
no test coverage detected