Lines Matching defs:ancestor
157 * <code>newChild</code> must not be null and must not be an ancestor of
167 * ancestor of this node
178 throw new IllegalArgumentException("new child is an ancestor");
419 * Returns true if <code>anotherNode</code> is an ancestor of this node
420 * -- if it is this node, this node's parent, or an ancestor of this
421 * node's parent. (Note that a node is considered an ancestor of itself.)
428 * @param anotherNode node to test as an ancestor of this node
436 TreeNode ancestor = this;
439 if (ancestor == anotherNode) {
442 } while((ancestor = ancestor.getParent()) != null);
458 * @return true if this node is an ancestor of <code>anotherNode</code>
468 * Returns the nearest common ancestor to this node and <code>aNode</code>.
469 * Returns null, if no such ancestor exists -- if this node and
471 * null. A node is considered an ancestor of itself.
475 * @param aNode node to find common ancestor with
476 * @return nearest ancestor common to this node and <code>aNode</code>,
508 // Move up the tree until we find a common ancestor. Since we know
510 // unknowingly (if there is a common ancestor, both nodes hit it in
579 TreeNode ancestor;
582 ancestor = this;
583 while((ancestor = ancestor.getParent()) != null){
651 * the ancestor with a null parent.
657 TreeNode ancestor = this;
661 previous = ancestor;
662 ancestor = ancestor.getParent();
663 } while (ancestor != null);
817 * <code>ancestor</code> to this node. The enumeration's
818 * <code>nextElement()</code> method first returns <code>ancestor</code>,
819 * then the child of <code>ancestor</code> that is an ancestor of this
822 * and <code>ancestor</code>, inclusive. Each <code>nextElement()</code>
830 * @exception IllegalArgumentException if <code>ancestor</code> is
831 * not an ancestor of this node
832 * @return an enumeration for following the path from an ancestor of
835 public Enumeration pathFromAncestorEnumeration(TreeNode ancestor) {
836 return new PathBetweenNodesEnumeration(ancestor, this);
1459 public PathBetweenNodesEnumeration(TreeNode ancestor,
1464 if (ancestor == null || descendant == null) {
1474 while (current != ancestor) {
1476 if (current == null && descendant != ancestor) {
1477 throw new IllegalArgumentException("node " + ancestor +
1478 " is not an ancestor of " + descendant);