MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getAncestors

Method getAncestors

src/main/java/org/htmlunit/html/DomNode.java:525–535  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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}

Callers 3

isDisplayedMethod · 0.95

Calls 3

getParentNodeMethod · 0.95
getParentNodeMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected