Re: Specific Cloning Question
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Fri, 22 Sep 2006 16:56:44 GMT
"Alex" <alexander.webb@xxxxxxxxx> wrote in message news:1158934564.874336.109020@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am not entirely sure what you mean by a "recursive solution". I have
tried cloning the tree by cloning all the nodes in it. However the
problem here is that when I try to clone Node A it has a reference to
Node B as its parent so Node B gets cloned. But when I am cloning Node
B, it has a reference to Node A as its child it goes back to trying to
clone A again.
If you only clone in "one direction", you can avoid this problem. For example, cloning a node Foo wil clone it, and all of its children, but none of its parents.
Alternatively, you could wrap all your nodes in an actual Tree object, and put a clone method on the tree, and not on any of the nodes themselves, and have the tree orchestrating the cloning of the nodes.
- Oliver
.
- Follow-Ups:
- Re: Specific Cloning Question
- From: Alex
- Re: Specific Cloning Question
- References:
- Specific Cloning Question
- From: Alex
- Re: Specific Cloning Question
- From: Thomas Weidenfeller
- Re: Specific Cloning Question
- From: Alex
- Re: Specific Cloning Question
- From: Oliver Wong
- Re: Specific Cloning Question
- From: Alex
- Specific Cloning Question
- Prev by Date: Re: jawk long string arguments
- Next by Date: Re: availableProcessors() : wrong amont of CPU?
- Previous by thread: Re: Specific Cloning Question
- Next by thread: Re: Specific Cloning Question
- Index(es):
Relevant Pages
|