[jdom-interest] Re: List's in JDOM - a small essay

Patrick Dowler patrick.dowler at nrc.ca
Fri Mar 9 13:44:53 PST 2001


On 09 March 2001 11:30, Joseph Bowbeer wrote:
> I'm interested in comparing the singly linked design with the design I
> sketched in a previous message, which is a sequential list implementation
> based on a reversible, mutable FilterListIterator and using an ArrayList or
> a LinkedList as the underlying representation.

FilterIterator-type semantics are very convenient and powerful, aside from
having any FIlterList at all. One could simple get an Iterator from the
element's LinkedList and wrap a FilterIterator around it.

> Using an ArrayList as the underlying representation is very lean in terms
> of memory usage and very performant for a large set of uses.  A filtered
> version of this would have the performance characteristics of a
> doubly-linked list, with no significant additional memory overhead.

Until you try to insert near the front of a large list :-( 

Having said that, some uses favour ArrayList and others favour LinkedList.
The fact that both exist is testament to the fact that neither is best in all 
cases.

Uses of doubly-linked/reverse traversal:

- applications which allow for interactive editting of content: in an 
   editor, do you use up-arrow or down-arrow more?

- applications which look for structural patterns: ie. how would this impact 
  XPath design/implementation?

I think tailoring JDOM for forward traversal is good for people doing 
server-side web (ie. streaming) apps, but maybe not for everyone.

-- 
Patrick Dowler
Canadian Astronomy Data Centre
National Research Council
Victoria, BC



More information about the jdom-interest mailing list