From: Jimmy Z. <cra...@co...> - 2007-04-17 23:19:49
|
If the goal of unbinding is not for reuse, then it is reasonable that there is no need for unbinding.. in other words, if you don't want a bookmark object to bind to another VTDNav object, then it is very likely that it is the end of the application, and those bookmarks should be gc'ed ... any comment? ----- Original Message ----- From: "Rodrigo Cunha" <rn...@gm...> To: "Jimmy Zhang" <cra...@co...> Cc: <vtd...@li...> Sent: Monday, April 16, 2007 2:14 AM Subject: Re: [Vtd-xml-users] Random Access Proposal (take 2) > Sorry about the delay but I've been sick with a nasty upper respiratory > tract infection ... back to work now! > > Yes, you're right, I can bind to another VTDNav object, but that sounds > like a kludge when the objective is really unbinding, and may imply > internal bufer allocation inside the bookmark object if the depth > increases. > > > Jimmy Zhang wrote: >> setCursorPosition() and getCursroPosition() have been added in CVS >> >> but the benefit of unbind() is still not clear >> >> if GC of VTDnav is the goal then one can simply call >> "setCursorPosition()" on >> a different VTDNav object and the mission is accomplished without having >> a >> unbind method for bookMark... >> >> >> ----- Original Message ----- From: "Rodrigo Cunha" <rn...@gm...> >> To: "Jimmy Zhang" <cra...@co...> >> Sent: Thursday, April 05, 2007 2:41 AM >> Subject: Re: [Vtd-xml-users] Random Access Proposal (take 2) >> >> >>> Jimmy Zhang wrote: >>> >>> > What if a bookmark object is created, but not yet bind to a non-null >>> VTDNav object... >>> >>> That's for unbind, right? The unbind rationale is to allow GC of VTDNav >>> objects while still allowing easy reusing of bookmark. Obviously you >>> could bind them to a dummy VTDNav instead, but that's a kludge, and >>> requires more processing. Or you could allow binding to null, but that >>> could lead to unnoticed errors. >>> >>> > recordCursorPosition() and setCursorPosition() would throw >>> NullPointerException.. would that bother you? >>> >>> No, that's what would happen really, and seems perfectly correct. >>> >>> -- >>> Rodrigo >>> >>> >> >> >> > > |