[jdom-interest] request for convenience methods
Taylor , Patrick
ptaylor at rational.com
Tue Feb 20 22:02:34 PST 2001
Actually, there is already a hasMixedContent() -- I was
suggesting isEmpty() to test for no content AND no attributes
(no, this wasn't clear from my original message).
Perhaps it's not such a good idea after all.
I think hasAttributes() is a good idea because it avoids
the overhead of creating a new PartialList on every call,
as getAttributes() does, even when there are no attributes.
Actually, why doesn't getAttributes() just return the
attribute list directly, instead of returning a new
PartialList containing all of the same attributes?
> -----Original Message-----
> From: Jason Hunter [mailto:jhunter at collab.net]
> Sent: Thursday, February 15, 2001 9:16 PM
> To: Taylor , Patrick
> Cc: Jdom-Interest (E-mail)
> Subject: Re: [jdom-interest] request for convenience methods
> I'll add them to the TODO.txt as things to consider. If people have
> opinions, speak up. BTW, the existing way to do these cmds is:
> elt.getAttributes().isEmpty() // instead of hasAttributes
> elt.getMixedContent().isEmpty() // instead of isEmpty
> "Taylor , Patrick" wrote:
> > It would be nice if Element had the following convenience methods:
> > // for consistency with hasChildren(), hasMixedContent()
> > boolean hasAttributes();
> > // is completely empty? ie, "<ELEM/>" or "<ELEM><ELEM/>"
> > boolean isEmpty();
> > _______________________________________________
> > To control your jdom-interest membership:
uraddr at yourhost.com
More information about the jdom-interest