From: Rodrigo C. <rn...@gm...> - 2007-03-28 10:17:21
|
Hi! The getNavigator() method might spare some parameter passing, since if I'm gona pass a bookmark around to another object I'll need to pass the navigator also, somehow. It's not critical, but since it can be done trivially, why not? Also, being able to ask the bookmark "hey you, to witch navigator do you belong?" seems the phylosophically correct thing to do. equals() and hashCode() are religious issues, just keep them your way :-) A hashCode function should ideally spread the input amongst all the hashcodes space, since collections using hashcodes might, or might not, use all bits in the hashcode. But just don't bother with that. Jimmy Zhang wrote: > Rodrigo, I just checked in a quick update into CVS > > Regarding some of prior comments, my questions are > > 1. When would a user call getNavigator() any way? I kinda had > a tough time coming up the scenario... > > 2. Regarding equals(), I think that the current bookMark implementation > should be fine in that the only time two bookMark instances are equal > is when they contains node position of the same VTDNav instance, and > the node indices are equal... > > 3. I am still not sure about hashCode, what is the purpose of the > spread? > For the current implementation, there will never be colision for the > bookmarks > corresponding to the same document (the node index is ideal)... > > Let me know your thoughts.. > Regards, > jimmy > |