[jdom-interest] Re: About filters

Joseph Bowbeer jozart at csi.com
Thu Jan 11 14:36:37 PST 2001


A list filter is so generic that I wonder whether it really belongs in
JDOM.

It would be more reusable if it were part of a Collections toolkit.  For
example, someone could provide an Iterator baseclass with a (filter)
constructor, or a FilteredList with a (list, filter) constructor.

----- original message -----
phil at triloggroup.com phil at triloggroup.com
Thu, 11 Jan 2001 16:02:53 +0100

As I'm extracting child elements from a parent one, I need something to
filter the extracted elements, more powerful than the name. I suggest
having a getChildren() method taking a filter callback, as a parameter.
The filter interface my be something like:

interface ElementFilter {
    boolean accept( Element child );
}






More information about the jdom-interest mailing list