[jdom-interest] Replace Element?

Jools Enticknap jools at jools.org
Thu Jun 22 13:21:10 PDT 2000


On Thu, 22 Jun 2000, Thomas M. Sasala wrote:

> 
> 	The problem is there is no indexOf for 
> element....which I have implemented in my local
> copy of Element....is it a worth wild change
> across the board?

You can call indexOf on the List which contains the Object you are
interested if you need to know what it's index is.

--Jools



> 
> Jools Enticknap wrote:
> > 
> > Call getChildren() on the Element.
> > 
> > Then call add( int index, Object current ) and specify where you want the
> > new object to be inserted.
> > 
> > --Jools
> > 
> > On Wed, 21 Jun 2000, Thomas M. Sasala wrote:
> > 
> > >       I know it's not possible with the current API, but is
> > > it possible to replace a element with a new element *without*
> > > effecting the order in which elements are stored?  We're
> > > having a problem where elements (children) at the same level
> > > are being processed, deleted, and added again.  The problem
> > > is when they are added, the original order of the children
> > > is being mucked up.  The 'new' element (aka, the processed
> > > element) is being added to the end of the list, instead of
> > > where the original element sat.  The effect is obvious and
> > > intended with the API as it stands now.  However, is there
> > > any reason a replaceElement can't be added?  I've looked
> > > through the code and it looks feasible, but the PartialList
> > > implementation may cause an issue.  I don't really
> > > understand it well enough to know what effect mucking with
> > > children will have on the backingList.  Any ideas?
> > >
> > >       -Tom
> > > _______________________________________________
> > > To control your jdom-interest membership:
> > > http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> > >
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> 




More information about the jdom-interest mailing list