[jdom-interest] Re: Optimized Lists

phil at triloggroup.com phil at triloggroup.com
Thu Jan 10 23:56:57 PST 2002

First, I think we misunderstood something: the goal is not to replace the Filter lists by another list implementation.
They are well designed and coded. I just want to optimize things when we want to browse an XML document without any

>>>Re-implement all of the methods in the List interface<<<
The ArrayList API is now stable and I hope that this will not change in the future, else lots of existing java code will
be obsolete! In another hand, the safer way is to build our own List class, which is pretty easy. But I don't believe
that it is necessary.

>>>As a sanity check, I think one should check that a child is the child of the parent<<<
>>>Duplicate Attributes, single root element<<<
Agree, and not a great deal.
In fact, all theses checks is should be moved to the actual list implementation.

>>>after thinking about it some more, I think as Alex eluded too, the real stickler is getChildren()<<<
getchildren() will always return a FilterList, which is the best implementation for that. The Content/AtributeList will
be returned only by getContent()/getAttributes(). No filter will be applied to these list!

>>>Even with getChildrenIterator you'll have most of the same issues as FilterListIterator (that nasty remove method :)
As in many List implementation, the remove() method may *not* be implemented: this is not mandatory. Sun states in its
documentation: @exception UnsupportedOperationException if the remove operation is not supported by this Iterator.
By the way, this kind of method is implemented successfully in DOM4J.

Again, after looking at the profiler results, we spent most of the time browsing XML documents (XPath/element
search...). And, for my point of view, this really needs to be optimized.


More information about the jdom-interest mailing list