Hi
I have two feature requests concerning fullCopy():
When a node is copied with fullCopy(), then the parent field is also copied. This means that some inherited attributes work on the copy even before it is placed in a new position in the tree (and some can give wrong values). However, this might not always be desired, and can also mask bugs. I suggest that the parent field is set to null in the copy.
All non-abstract node types override fullCopy(), and thus the following will compile clean:
A newA = getA().fullCopy();
However, for abstract node types it will need a cast, since the return value of fullCopy() will be the nearest non-abstract superclass.
I suggest that the following declaration is added to all abstract node types:
public abstract A fullCopy();
Where A is the name of the node type. This would mean that the return type of B.fullCopy() would be B for all node types B.
Jesper
Jesper MATTSSON, MSc
Software Developer & IT Administrator
Phone direct: +46 73 324 5909
Email: jesper.mattsson_at_modelon.com<mailto:jesper.mattsson_at_modelon.com>
[cid:image001.png_at_01CCEB2B.16144510]
________________________________
Modelon AB
Ideon Science Park
SE-223 70 Lund, Sweden
Phone: +46 46 286 2200
Fax: +46 46 286 2201
Web:
http://www.modelon.com<
http://www.modelon.com/>
Received on Tue Feb 14 2012 - 15:26:38 CET