[jdom-interest] Sorting Children, Collections.sort, ComodificationException, etc., etc.

bob mcwhirter bob at werken.com
Mon Sep 23 11:07:09 PDT 2002


List contentList = new ArrayList( element.getContext() );

element.setContent( null );

	-bob


On Mon, 23 Sep 2002, Bradley S. Huffman wrote:

> Damn, your right :( I'm beginning to really hate "live" lists. What I really
> want is setContent() to return a List of the old children detached instead
> "this element modified".
> 
> Brad
> 
> Gordon Tyler writes:
> 
> > Bradley S. Huffman wrote:
> > 
> > > public static void sortContent(Element element, Comparator comparator) {
> > >     // Get a List of the current children
> > >     List contentList = element.getContent();
> > > 
> > >     // Temporarily remove all content
> > >     element.setContent(null);           
> > 
> > But since the list returned by element.getContent() is a "live" list, 
> > wouldn't this statement empty contentList?
> > 
> > Ciao,
> > Gordon
> > 
> > -- 
> > Gordon Tyler
> > Software Developer, R&D
> > Sitraka -- Performance is Mission Critical
> > 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> 

--
Bob McWhirter        bob at werken.com
The Werken Company   http://werken.com/




More information about the jdom-interest mailing list