Produce a series of statements with side effects on
so that the new instance becomes equivalent to
In the specification of this method, we mean by equivalent that, after the method
returns, the modified instance is indistinguishable from
newInstance in the behavior of all methods in its
The implementation typically achieves this goal by producing a series of
"what happened" statements involving the
and its publicly available state. These statements are sent
to the output stream using its
method which returns an expression involving elements in
a cloned environment simulating the state of an input stream during
reading. Each statement returned will have had all instances
the old environment replaced with objects which exist in the new
one. In particular, references to the target of these statements,
which start out as references to
oldInstance are returned
as references to the
Executing these statements effects an incremental
alignment of the state of the two objects as a series of
modifications to the objects in the new environment.
By the time the initialize method returns it should be impossible
to tell the two instances apart by using their public APIs.
Most importantly, the sequence of steps that were used to make
these objects appear equivalent will have been recorded
by the output stream and will form the actual output when
the stream is flushed.
The default implementation, calls the
method of the type's superclass.
|the type of the instances|
|The instance to be copied.|
|The instance that is to be modified.|
|The stream to which any initialization statements should be written.|
| if |