[jdom-interest] Contribution

Cromax cromax at amiga.pl
Mon Jan 12 06:56:02 PST 2004

----- Original Message ----- 
From: "Jason Hunter" <jhunter at servlets.com>
To: "Cromax" <cromax at amiga.pl>
Cc: <jdom-interest at jdom.org>
Sent: Sunday, January 11, 2004 8:18 PM
Subject: Re: [jdom-interest] Contribution

> Sorry, I don't remember seeing your mail.  Glad you followed
> up again.

No problem at all 8)

> For anyone with code improvements, this is the list on which
> to post them.  Your specific addition (of a new filter) is
> probably better done with XPath rather than filters as you
> allude.

Just as I supposed, 8) however I have an unclear suspicion,
that with XPath it may work slower. Well, never mind. 8)

> We designed the filter model so people could write their own
> filters.  We probably won't gather a "Top 10 Filters" for the
> core.  It'd shortly become "Top 100" no doubt.

To be frankly, it's just what I have thought, so that's why
I added "if anyone cares" --- but that's not a problem at all
8) --- that's what the _core_ is for 8)

>  We might put such filters in jdom-contrib which is a module
> full of useful code not appropriate for the core of JDOM.

I understand. Anyway, I decided to provide this patch. In
fact there are two patches and IMHO there is a quiet good
reason to at least look at them.

First patch does not contain additional code for attributes
matching (ElementFilter.java.1.diff). It simply has reworked
match() method, that in tests works slightly faster. It's
not very significant speedup (it's about 0,65%), but it is ;-)
Another advantage is, that the code seems (at least to
me ;-) to be more easier to understand now.

Second patch (ElementFilter.java.2.diff) contains additional
attributes matching functionality, but when no attributes are
provided (ie. the filter is supposed to work as the old one),
it still have some speed advantage over old version (it's
about 0,63% faster according to simple tests).

So, uhm, I don't know --- maybe you will find it in some
way usefull --- if yes I would be happy I could help 8)

Have a nice day,

More information about the jdom-interest mailing list