[jdom-interest] jdom 1.1

rolf.lear at algorithmics.com rolf.lear at algorithmics.com
Thu Sep 25 08:50:42 PDT 2008

Hi Katja.


getChildren() does not return a LinkedList. It returns a JDom specific class that implements the List interface.


I submitted a change to the ContentList class that made it in to JDom 1.1 that may have the result you are seeing. The change was all to do with the ListIterators from the JDom ContentList. The effect of the change is that the entire ContentList structure is scanned when the Iterator is created. In JDom 1.0 the content is only scanned when you do a previous/next operation on the iterator. (JDom1.1 is slower startup, but is fast to use, and has no bugs. JDom 1.0 was fast startup, slow to iterate, and had a bug).


Still, an iterator is not created if you do a getChildren().get(xxx), or a getChildren().size(). So, creating an iterator is not your problem.


Post your code again, please, and I will have a look.









From: jdom-interest-bounces at jdom.org [mailto:jdom-interest-bounces at jdom.org] On Behalf Of katja.radelicki at colruyt.be
Sent: Thursday, September 25, 2008 10:34 AM
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] jdom 1.1



maybe I put my question in other words:
the method getChildren returns a LinkedList in jdom 1.0 and 1.1.
Iterating the LinkedList with a for  loop in which you do a get(i) takes a lot of time --> O(n²). 
But why it does not take a lot of time in jdom 1.0? It's also O(n²)?
Which difference between jdom 1.0 and jdom 1.1 causes this difference in time?


This email and any files transmitted with it are confidential and proprietary to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received in error, use is prohibited. Please destroy, and notify sender. Sender does not waive confidentiality or privilege. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. Algorithmics does not accept liability for any errors or omissions. Any commitment intended to bind Algorithmics must be reduced to writing and signed by an authorized signatory.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20080925/5fdf8282/attachment.htm

More information about the jdom-interest mailing list