INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Gets the ancestors of the node. @return a list of the ancestors with the root at the first position
()
| 523 | * @return a list of the ancestors with the root at the first position |
| 524 | */ |
| 525 | public List<Node> getAncestors() { |
| 526 | final List<Node> list = new ArrayList<>(); |
| 527 | list.add(this); |
| 528 | |
| 529 | Node node = getParentNode(); |
| 530 | while (node != null) { |
| 531 | list.add(0, node); |
| 532 | node = node.getParentNode(); |
| 533 | } |
| 534 | return list; |
| 535 | } |
| 536 | |
| 537 | /** |
| 538 | * {@inheritDoc} |
no test coverage detected