I didn't originate the question, but I can give you a
couple of reasons why.

1. I can speculate that creation of a new object is more expensive
   than just clearing an existing one

2. The way I wrote a couple of servlets was I created a template
   class responsible for creation of general page look and feel. So a servlet
   would pass several dynamically generated elements to that template
   page which had to be removed after output was done so the template
   is ready to be reused.

Not sure if these examples are convinsing. Also, I was able to live without
clearElements() so far.

My 2c.

--V.

Stephan Nagy wrote:
> 
> "RESTREPO, ALEXANDER G [Non-Pharmacia/1000]" wrote:
> 
> > Hello ECS Gurus:
> >
> > Is there a simple way to clear a TR Element, for example:
> > (Is there a generic method that will work with any
> > HTML Element type????)
> >
> > TD td1   = new TD("Table Data 1");
> > TD td2   = new TD("Table Data 2");
> > TD td3   = new TD("Table Data 3);
> > TR myTR  = new TR();
> > myTR.addElement(td1);
> > myTR.addElement(td2);
> > myTR.addElement(td3);
> >
> > myTR.clearElements()<--------Is there a simple way to do this?????
> >
> 
> myTr = new TR(); // <--- would do it.
> 
> If you can provide me a good reason why you would want to clear the list
> of elements in an element i'll implement it as it is rather trivial
> otherwise the above will do it.
> 
> -stephan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to