Changeset 737 for trunk/sources/HeuristicLab.Data/ObjectData.cs
- Timestamp:
- 11/12/08 13:10:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/ObjectData.cs
r508 r737 27 27 28 28 namespace HeuristicLab.Data { 29 /// <summary> 30 /// Represents the base class for all base data types. 31 /// </summary> 29 32 public class ObjectData : ItemBase, IObjectData { 30 33 private object myData; 34 /// <summary> 35 /// Gets or sets the data to represent. 36 /// </summary> 37 /// <remarks>Calls <see cref="HeuristicLab.Core.ItemBase.OnChanged"/>.</remarks> 31 38 public virtual object Data { 32 39 get { return myData; } … … 39 46 } 40 47 48 /// <summary> 49 /// Clones the current instance. 50 /// </summary> 51 /// <remarks>HeuristicLab data items are cloned with the <see cref="HeuristicLab.Core.Auxiliary.Clone"/> method of 52 /// class <see cref="Auxiliary"/> (deep copy), all other items (like basic data types) 53 /// are cloned with their own <c>Clone</c> methods (shadow copy).</remarks> 54 /// <exception cref="InvalidOperationException">Thrown when the current instance is not cloneable.</exception> 55 /// <param name="clonedObjects">A dictionary of all already cloned objects.</param> 56 /// <returns>The clone instance.</returns> 41 57 public override object Clone(IDictionary<Guid, object> clonedObjects) { 42 58 ObjectData clone = (ObjectData)base.Clone(clonedObjects); … … 50 66 } 51 67 68 /// <summary> 69 /// Checks whether the current instance equals the specified <paramref name="obj"/>. 70 /// </summary> 71 /// <param name="obj">The object to compare with.</param> 72 /// <returns><c>true</c>, if both objects are the same or 73 /// the contained data is the same, <c>false</c> otherwise.</returns> 52 74 public override bool Equals(object obj) { 53 75 if(obj == this) return true; // same instance … … 59 81 } 60 82 83 /// <inheritdoc cref="object.GetHashCode"/> 61 84 public override int GetHashCode() { 62 85 return Data.GetHashCode(); 63 86 } 64 87 88 /// <summary> 89 /// Compares the current instance to the given <paramref name="obj"/>. 90 /// </summary> 91 /// <remarks>Can also compare basic data types with their representing HeuristicLab data types 92 /// (e.g. a <see cref="BoolData"/> with a boolean value).</remarks> 93 /// <exception cref="InvalidOperationException">Thrown when the current 94 /// instance does not implement the interface <see cref="IComparable"/></exception> 95 /// <param name="obj">The object to compare the current instance to.</param> 96 /// <returns><c>0</c> if the objects are the same, a value smaller than zero when the current instance 97 /// is smaller than the given <paramref name="obj"/> and a value greater than zero 98 /// when the current instance is greater than the given <paramref name="obj"/>.</returns> 65 99 public int CompareTo(object obj) { 66 100 IComparable comparable = Data as IComparable; … … 75 109 } 76 110 111 /// <summary> 112 /// The string representation of the current instance. 113 /// </summary> 114 /// <returns>"null" if property <see cref="Data"/> is <c>null</c>, else 115 /// the string representation of the current instance.</returns> 77 116 public override string ToString() { 78 117 if (Data == null) … … 82 121 } 83 122 123 /// <summary> 124 /// The point of intersection where an <see cref="IObjectDataVisitor"/> 125 /// can change the object. 126 /// </summary> 127 /// <param name="visitor">The visitor that changes the element.</param> 84 128 public virtual void Accept(IObjectDataVisitor visitor) { 85 129 visitor.Visit(this);
Note: See TracChangeset
for help on using the changeset viewer.