Posted 17 February 2008 - 11:07 AM
Yes, I understand WHY a collection is kept as references. But I am in a situation where I need to copy the data, the references.
What I am doing is making a copy of a MAP object, and passing it to a form, which edits the MAP object. Then, I need to be able to revert any changes to the map if the edits are cancelled. So, what I have done is create a temporary copy of the class in ram, while the user edits it. If the changes are accepted, then the old map object is deleted from an ArrayList (in another class), and the temporary map is pushed into the arraylist.
But, I need to be able to create the first temporary copy for the user to edit.
Inside the MAP class, there are a bunch of OSOP classes. The OSOPs contain some arraylists of String objects, as well as a few boolean values. In fact, they are more like a struct than a class, in that the OSOPs have no methods.
Anyway... I think Im just going to leave this as it is, given the ridiculous class structure under this one. By the time I call a ton of functions to get the values copied over, the serializer could have done its thing.
Thanks for the help though.
- My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)