[jdom-interest] [Fwd: JDOM trivia: Element.isAncestor method in Beta 9]

Phil Weighill-Smith phil.weighill-smith at volantis.com
Tue Feb 10 08:36:43 PST 2004


I know Beta 10 is now available, but thought I'd raise this point
(raised to me) against Beta 9 just in case...

The following javadoc for 

class org.jdom.Element 

    /**
     * Determines if this element is the ancestor of another element.
     *
     * @param element <code>Element</code> to check against
     * @return <code>true</code> if this element is the ancestor of the
     *         supplied element
     */
    public boolean isAncestor(Element element) {

is remarkable because the method does just the opposite :-)

e.g.

parent.isAncestor(child) is FALSE
child.isAncestor(parent) is TRUE       

-- 
Phil Weighill-Smith <phil.weighill-smith at volantis.com>
Volantis Systems
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040210/642da39c/attachment.htm


More information about the jdom-interest mailing list