|
Mike, I don't know what you are trying to accomplish and you say you "need to remove the object from a hashmap", but an alternative may be to use a WeakHashMap. Objects in a WeakHashMap can be garbage collected if there is no other reference. David Morris >>> msilvers@hbs-inc.com 11/14/02 10:51AM >>> I am creating a modification of the Singleton architecture. I am only permitting one of a specific object with specific attributes. When I am performing this function, I need to remove the object reference from a hashmap when the object is destroyed by the user. My question is this.... Should I place the code for removing the object reference from the hashmap in the destroy() method, or the finalize() method? My class is going to contain a static hashmap of objects with a key reference object. I am concerned that either the destroy() or finalize() does not get called when a class is given a null reference. I am thinking that one of the methods will get used for the last instance of the class and the other will be used for when each instance. any insights? Thanks Mike
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.