[jdom-interest] Contribution

Tomislaw Kitynski t.kitynski at 11interactive.com
Mon Jan 12 06:01:42 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)

> 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

>  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 to be more easier
to understand now.

Second patch (ElementFilter.java.2.diff) contains additional
attributes matching, but when no attributes are provided
(ie. the filter is supposed to be working 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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ElementFilter.java.2.diff
Type: application/octet-stream
Size: 7520 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20040112/98e099c0/ElementFilter.java.2.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ElementFilter.java.1.diff
Type: application/octet-stream
Size: 3873 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20040112/98e099c0/ElementFilter.java.1.obj

More information about the jdom-interest mailing list