Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Deep copy


  
  5.17 copy -- Shallow and deep copy operations
A shallow copy constructs a new compound object and then (to the extent possible) inserts references into it to the objects found in the original.
A deep copy constructs a new compound object and then, recursively, inserts copies into it of the objects found in the original.
The latter is called to implement the deep copy operation; it is passed one argument, the memo dictionary.
www.python.org /doc/current/lib/module-copy.html   (350 words)

  
 Java Programming - All about Deep /Shallow copy
All mutable objects referred to by member variables (or objects that you can't be sure won't be externaly mutated) need to be deep copies of their originals.
The disadvantage of the copy constructor is you have to know at compile time which class you have, or muck about with reflection.
In both cases, you have to ensure that all contained mutable objects are correctly copied (deep versus shallow), and that the copy proceeds recursively (for example, if you have a collection, you can't just copy the collection, you have to copy its members as well, and their contents, and so on).
forum.java.sun.com /thread.jspa?threadID=5195135&messageID=9769045   (1086 words)

  
 NSCopying
A deep copy is one in which every instance variable of the receiver is duplicated, not simply referenced in the copy.
A deep copy is thus a completely separate object from the original; changes to it don't affect the original, and changes to the original don't affect it.
The copy returned is immutable if the consideration "immutable vs. mutable" applies to the receiving object; otherwise the exact nature of the copy is determined by the class.
www.cilinder.be /docs/next/NeXTStep/3.3/nd/Foundation/Protocols/NSCopying.htmld/index.html   (341 words)

  
 Deep copy and recursion (feb 00)
Upon inspection, I found that the object was being initialized from a shallow copy of a template, and I told the author that he needed to deep copy the template instead.
What we really needed was not only a copy of the reference, but a copy of to what the reference pointed.
Similarly, a new hashref is constructed by copying each element, including a deep copy of its value.
www.stonehenge.com /merlyn/UnixReview/col30.html   (1394 words)

  
 C++: Shallow vs Deep Copies
A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields.
To make a deep copy, you must write a copy constructor and overload the assignment operator, otherwise the copy will point to the original, with disasterous consequences.
If an object has pointers to dynamically allocated memory, and the dynamically allocated memory needs to be copied when the original object is copied, then a deep copy is required.
www.fredosaurus.com /notes-cpp/oop-condestructors/shallowdeepcopy.html   (213 words)

  
 JavaTechniques | Low-Memory Deep Copy
"Faster Deep Copies of Java Objects" explains the concept of "deep copies" of Java objects and illustrates a common approach for copying objects using Java Object Serialization.
The bad news is that this approach is more than twice as slow as even the unoptimized variant of the deep copy utility illustrated in "Faster Deep Copies of Java Objects".
If, for example, the buffer size is set to a value larger than the serialized size of the object being copied (effectively eliminating the memory advantages of the piped approach), the copy still takes nearly 50% longer than the single-threaded approach.
javatechniques.com /public/java/docs/basics/low-memory-deep-copy.html   (967 words)

  
 copy
Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances).
Two problems often exist with deep copy operations that don't exist with shallow copy operations: a) recursive objects (compound objects that, directly or indirectly, contain a reference to themselves) may cause a recursive loop b) because deep copy copies *everything* it may copy too much, e.g.
epydoc.sourceforge.net /stdlib/copy-module.html   (274 words)

  
 6. Identity, Equality, Copy
Copying of objects can be performed as a deep copy (object's structureand the objects pointed to by its variables are copied) or shallow copy(objects pointed to by variables, their variables are not copied, but areshared with the original object).
A shallow copywill copy the objects fields including the current contents of those fields.If the content is a reference to another object, no attempt is made torecursively copy the objects attached to the reference.
The effect of copying is determined in accordance with the possibilitiesprovided by the implementation language.
www.objs.com /x3h7/sec6.htm   (3205 words)

  
 QuEP 4: reducing abstraction penalty by means of disposable arrays
An implementation of a "disposable" array is proposed which reduces the abstraction penalty by eliminating unnecessary copying of the returned array.
A copy constructor and assignment operator would be added to Array which copy a disposable array with the same semantics, namely, the inner pointer to the allocated storage space and the corresponding informations are simply swapped between the array and the disposable array.
This inexpensive pointer-copy operation will hereafter be referred to as shallow copy, as opposed to the usual deep copy in which each element of the source array is copied to the corresponding element of the target.
quantlib.org /quep/quep004.html   (1102 words)

  
 [No title]
Normally, shared copies reference the same data to optimize memory use and for maximum speed.
This ensures that all threads get a unique copy of the data, and that any assignments to global_string will result in a deep copy.
Returns a deep copy of the encapsulated data.
www.gl.umbc.edu /env/beta/sun4x_58/qt/qdeepcopy_3qt.html   (444 words)

  
 lua-users wiki: Copy Table
This function returns a deep copy of a given table.
The code properly handles the case where the original table nests another table multiple times, in which case only a single copy of the nested table is made.
This code does not deep copy userdata or lightuserdata since it does not have knowledge how to do that.
lua-users.org /wiki/CopyTable   (209 words)

  
 Using C# to Program Generic .NET Interfaces > Copy Semantics and ICloneable   (Site not responding. Last check: )
Copy is done via c2 = c1 -----original----- Course : Intro to C# with 2 students John Mary -----copy----- Course : Intro to C# with 2 students John Mary -----copy with changed title and new student----- Course :.
Deep copy can be provided at either the language level or the library level.
In C++, deep copy is provided at the language level through a copy constructor.
www.phptr.com /articles/article.asp?p=25352&seqNum=3&rl=1   (830 words)

  
 Very Deep Copy Project Morphic Squeak Smalltalk   (Site not responding. Last check: )
The easiest way is to use the halo menu and say "copy and print...
/copy to paste buffer", then go to the other project, open the World menu, and say "new morph/from paste buffer".
But this will give you a duplicate (via veryDeepCopy), so any changes to the original will not be made in the new one.
www.visoracle.com /squeakfaq/very-deep.html   (188 words)

  
 5 Deep©
At 5 deep we respect the right to privacy of all individuals and the need to have their privacy protected.
While every care is taken in verifying that all information supplied is accurate and relevant, 5 deep makes no representations with regards to the information of products or services nor the accuracy thereof.
5 deep shall not by any means whatsoever be liable under any circumstances for any damages, loss, cost, charges or loss of profits, including such damages or loss consequential to the use of any information regarding services and products offered on this website.
www.5deep.co.uk /policy.asp   (320 words)

  
 Copying Collection Classes
A shallow copy of an object is a new object whose instance variables are identical to the old object.
A deep copy of an object is a new object with entirely new instance variables; it does not share objects with the old.
This copying is not done recursively, and the new instance variables are shallow copies of the old instance variables.
www.roguewave.com /support/docs/leif/sourcepro/html/toolsug/6-4.html   (517 words)

  
 Java Tip 76: An alternative to the deep copy technique - Java World
A deep copy occurs when an object is copied along with the objects to which it refers.
If either of these contained objects themselves contain objects, then, in a deep copy, those objects are copied as well, and so on until the entire graph is traversed and copied.
In this case, there must be two copy functions for each object: one for a deep copy and one for a shallow.
www.javaworld.com /javaworld/javatips/jw-javatip76.html   (610 words)

  
 MemberwiseClone Method
A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object.
If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object.
In contrast, a deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object.
msdn.microsoft.com /library/default.asp?url=/library/en-us/cpref/html/frlrfSystemObjectClassMemberwiseCloneTopic.asp   (489 words)

  
 Copying Topic Map Objects
A deep copy copies all of the objects considered to be "contained" within the source object (as deep copies) and creates shallow copies of referenced Topic objects.
As an example of the difference between a shallow and a deep copy, consider copying a topic with a base name and an occurrence that plays a role in an association and has a single typing topic.
This results in a topic count of 5 (the copied topic, the shallow-copied typing topic and the 3 topics used to define the XTM class-instance association) and an association count of 1 (the XTM class-instance association).
tm4j.org /docs/devguide/ch04s03.html   (697 words)

  
 Faronics FAQ's - Deep Freeze
When the evaluation period is finished, the Deep Freeze icon in the System Tray has a flashing X indicating that Deep Freeze is in the Thawed state.
To generate an OTP, start by opening the Deep Freeze login box on the workstation you wish to generate it for, and write down the Token code, which is located at the top of the login box.
The primary use for Deep Freeze is to remove any changes made to a workstation after a restart.
www.faronics.com /faq   (1882 words)

  
 Common Object Operations in .NET > Object Cloning   (Site not responding. Last check: )
For those of you who are unfamiliar with the term, a shallow copy is one in which the values in an object's fields are copied but what the fields refer to is not copied.
So, if you made a deep copy of an object that has a field that refers to a string, you'd be creating a new object and a new string—the new object would refer to the new string.
The important thing to note about a deep copy is that the original and the new object share nothing; modifying one object has no effect on the other object.
www.informit.com /articles/article.asp?p=25914&seqNum=4   (719 words)

  
 Working with the Handle/Body Classes
A copy of a handle still refers to the original body, and methods that affect data operate on the original body.
Sometimes it is important for the copy of a handle to be a deep copy, which instantiates a new body class for the new handle to reference, rather than having the new handle point to the same body class.
Each copy of the element would need to contain a full copy of the element, including a nested copy of the element.
www.roguewave.com /support/docs/leif/leif/html/xmlbindingug/7-6.html   (554 words)

  
 3.18 copy -- Shallow and deep copy operations
3.18 copy -- Shallow and deep copy operations
This version does not copy types like module, class, function, method, stack trace, stack frame, file, socket, window, array, or any similar types.
Classes can use the same interfaces to control copying that they use to control pickling: they can define methods called
www.python.org /doc/2.2.3/lib/module-copy.html   (331 words)

  
 Brad Abrams : Implementing ICloneable
Deep-copy copies the cloned object and all objects referenced by the object, recursively until all objects in the graph are copied.
A non-deep copy (referred to as ‘shallow’ if only the top level references are copied) may do none, or part of a deep copy.
If it’s a deep copy have a method called deepcopy (or something similar), if it’s not then call the method it shallowcopy.
blogs.msdn.com /brada/archive/2003/04/09/49935.aspx   (949 words)

  
 cyll.org   (Site not responding. Last check: )
Produces a shallow copy of obj.the instance variables of obj are copied, but not the objects they reference.
Copies the frozen and tainted state of obj.
While clone is used to duplicate an object, including its internal state, dup typically uses the class of the descendent object to create the new instance.
cyll.org /blog/tech/2006-05-26-noiwantthedeepcopy.html   (164 words)

  
 [No title]
The copied object may or may not contain exactly the same state * (the same instance variable values) as the original.
You will * see that the first part of the clone in the deep copy is the same as * it was for the shallow copy.
Likewise, it makes no sense to assume that a * deep copy would be necessary, or even correct.
www.idevelopment.info /data/Programming/java/object_oriented_techniques/CloningExample.java   (888 words)

  
 Why Copying an Object is a terrible thing to do?
In this case, if C++ run-time were to make deep copies of every pointed object, then two copies of Brain would exist, one for sam and one for bob.
We want to deep copy what’s being aggregated, however, what we want to do with associated objects is not clear.
Copying an object by specifying new followed by the class name often leads to code that is not extensible.
www.agiledeveloper.com /articles/cloning072002.htm   (2110 words)

  
 Dennis' Blog : Copy constructors
A copy constructor is a constructor which takes a (single) parameter of an existing object of the same type as the constructor’s class.
The copy constructor is less known in.NET, because the Framework has the Object.MemberwiseClone (for shallow copies) and the ICloneable interface for your own cloning operation (a deep copy if you feel like it).
The developer implementing the copy constructor has to know both the implementation details of the object's storage and derived properties, which is acceptable in the context of the deep clone task.
bloggingabout.net /blogs/dennis/archive/2006/06/16/12517.aspx   (1424 words)

  
 Dr. Dobb's | C++/CLI: Cloning | August 22, 2005
The handle returned is to a new object that is a copy of the object on which it is called.
Copying an object typically entails creating a new instance of its class, but it also may require copying of internal data structures as well.
It creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned.
www.ddj.com /dept/cpp/184402005   (1247 words)

  
 Andreas Schaefer's Blog: Cloneable: How an old Bug can bite for a very long time
Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies.
Currently it is not possible to create a deep copy without using serialization or reflection if I need a container that is completely independent of the source.
This is an issue of persistence and not of a shallow or deep copy.
weblogs.java.net /blog/schaefa/archive/2004/10/cloneable_how_a.html   (1357 words)

  
 Making Deep Copies of Objects, Using strictfp, and Optimizing String Performance
Doing 50,000 copies in 8,500 milliseconds means that it didn't take very long to do a single copy.
A final point about copying through serialization is that all the objects that the serialization process encounters must be serializable.
For more information about deep copying, see Section 3.9.3, Shallow versus Deep Cloning, and Section 15.7, Object Serialization, in "The Java Programming Language Fourth Edition" by Arnold, Gosling, and Holmes.
java.sun.com /developer/JDCTechTips/2001/tt0410.html   (1791 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.