| | |
Question about clone a Hashtable
![]() |
•
•
Join Date: Nov 2004
Posts: 189
Reputation:
Solved Threads: 0
Hello everyone,
I want to clone the content of a Hashtable (its keys, its values and its key-value relationship). But I have found that the clone method can not completely clone a Hashtable, as is mentioned in the description of clone method of Java API Specification,
Creates a shallow copy of this hashtable. All the structure of the hashtable itself is copied, but the keys and values are not cloned. This is a relatively expensive operation.
I am wondering what is the efficient and effective approach of cloning a Hashtable, including the clone of its keys, its values and its key-value relationship.
Thanks in advance,
George
I want to clone the content of a Hashtable (its keys, its values and its key-value relationship). But I have found that the clone method can not completely clone a Hashtable, as is mentioned in the description of clone method of Java API Specification,
Creates a shallow copy of this hashtable. All the structure of the hashtable itself is copied, but the keys and values are not cloned. This is a relatively expensive operation.
I am wondering what is the efficient and effective approach of cloning a Hashtable, including the clone of its keys, its values and its key-value relationship.
Thanks in advance,
George
![]() |
Similar Threads
- C command-line I/O question (C++)
- Straight C (C++)
- What Would You Pay? (Promotion and Marketing Plans)
- Question about content (Growing an Online Community)
- outlook 97 will not run (Windows NT / 2000 / XP)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the Java Forum
- Previous Thread: Which is worse?
- Next Thread: Printing Embedded JComponents
| Thread Tools | Search this Thread |
-xlint add android api applet application array automation bank bi binary blackberry block bluetooth class clear client code compile compiler component database developmenthelp dice eclipse equation error event fractal functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite int j2me j2seprojects java javac javame javaprojects jetbrains jni jpanel jtable julia learningresources lego linux mac main map method mobile myregfun netbeans notdisplaying number online openjavafx pearl problem program project qt scanner screen scrollbar server set singleton sms sort spamblocker sql sqlserver storm string superclass swing system textfields thread threads time title tree tutorial-sample update variablebinding windows xor





