- Timestamp:
- 12/02/08 14:13:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactorBranch/HeuristicLab.Constraints/AndConstraint.cs
r764 r885 44 44 } 45 45 46 /// <summary> 47 /// Default constructor for an empty AndConstraint. 48 /// </summary> 46 49 public AndConstraint() { 47 50 clauses = new ItemList<IConstraint>(); 51 } 52 53 /// <summary> 54 /// Copy constructor to create clones (deep). 55 /// </summary> 56 /// <param name="original">The original instance to be cloned.</param> 57 public AndConstraint(AndConstraint original) : this(original, new Dictionary<Guid, object>()) { } 58 /// <summary> 59 /// Copy constructor to create clones (deep) reusing already cloned object references. 60 /// </summary> 61 /// <param name="original">The instance to be cloned.</param> 62 /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param> 63 protected AndConstraint(AndConstraint original, IDictionary<Guid, object> clonedObjects) 64 : base(original, clonedObjects) { 65 this.Clauses = (ItemList<IConstraint>)Auxiliary.Clone(original.Clauses, clonedObjects); 48 66 } 49 67 … … 60 78 return new AndConstraintView(this); 61 79 } 62 80 /// <summary> 81 /// Uses copy constructor to create a deep clone reusing already cloned object references. 82 /// </summary> 83 /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param> 84 /// <returns></returns> 63 85 public override object Clone(IDictionary<Guid, object> clonedObjects) { 64 AndConstraint clone = new AndConstraint(); 65 clonedObjects.Add(Guid, clone); 66 clone.Clauses = (ItemList<IConstraint>)Auxiliary.Clone(Clauses, clonedObjects); 67 return clone; 86 return new AndConstraint(this, clonedObjects); 68 87 } 69 88
Note: See TracChangeset
for help on using the changeset viewer.