![]() ![]() The second function works fine, however, in copy1, if I remove a vertix from the copy graph, it would be also removed from the original one. I have written two different copying functions, copy1 and copy2. This terminology and semantics easily confuse many beginners. I want to have a copy of this graph and make some changes in the copy while the original graph does not change. Unfortunately, when we deal with objects we are really dealing with object-handles called references which are passed-by-value as well. Thats way every user must have his own copy to operate on it. next time, bring the data from hashmap.Įdit: That data coming from DB creates a online form and has default values like name and address and sex… All user have to edit the form for their own purposes. The process is so: bring first the data from DB, make classes and put all classes into a transfer object and put that transfer object into a hashmap. In this method, first, convert the map to JSON string and JSON string back to a new map object. The Object I've to clone is, a transfer object, which has references to other Object and HashMaps. Another way to clone a HashMap is to use Googles JSON library. My second question is, in case I can use a HashMap to save the data, I've to make a deep copy or clone of the data brought and put in the HashMap, so each user have a copy of the origin data. My first question is: Is it correct, to save the data brought from DB in a HashMap, so I don't have to query it from DB every time? But the big problem is, that all user will operate on the same data, which they change. That way I dont't have to bring it every time into the webapplication. What I did is, that I took the data and put it into the HashMap. In my webapplication, I've to bring the same data from DB into the webapplicatio, which takes lots of time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |