- Timestamp:
- 01/27/09 09:31:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Constraints/SubOperatorsTypeConstraint.cs
r764 r1176 29 29 30 30 namespace HeuristicLab.Constraints { 31 /// <summary> 32 /// Constraint where the sub-operator at a specific index has to be an element of a pre-defined group. 33 /// </summary> 31 34 public class SubOperatorTypeConstraint : ConstraintBase { 32 35 private IntData subOperatorIndex; 36 /// <summary> 37 /// Gets the index of the sub-operator. 38 /// </summary> 33 39 public IntData SubOperatorIndex { 34 40 get { return subOperatorIndex; } … … 36 42 37 43 private List<IOperator> subOperators; 44 /// <summary> 45 /// Gets all allowed sub-operators. 46 /// </summary> 38 47 public IList<IOperator> AllowedSubOperators { 39 48 get { … … 42 51 } 43 52 53 ///<inheritdoc select="summary"/> 44 54 public override string Description { 45 55 get { return "The sub-operator at a specific index has to be an element of a pre-defined group."; } 46 56 } 47 57 58 /// <summary> 59 /// Initializes a new instance of <see cref="SubOperatorTypeConstraint"/>. 60 /// </summary> 48 61 public SubOperatorTypeConstraint() 49 62 : base() { … … 52 65 } 53 66 67 /// <summary> 68 /// Initializes a new instance of <see cref="SubOperatorTypeConstraint"/> with the given 69 /// <paramref name="index"/>. 70 /// </summary> 71 /// <param name="index">The index of the sub-operator.</param> 54 72 public SubOperatorTypeConstraint(int index) : base() { 55 73 subOperatorIndex = new IntData(index); … … 57 75 } 58 76 77 /// <summary> 78 /// Adds the given operator to the list of sub-operators. 79 /// </summary> 80 /// <remarks>Calls <see cref="ItemBase.FireChanged"/> of base class <see cref="ConstraintBase"/>.</remarks> 81 /// <param name="op">The operator to add.</param> 59 82 public void AddOperator(IOperator op) { 60 83 if(!subOperators.Contains(op)) { … … 64 87 } 65 88 89 /// <summary> 90 /// Removes the given operator from the list of sub-operators. 91 /// </summary> 92 /// <remarks>Calls <see cref="ItemBase.FireChanged"/> of base class <see cref="ConstraintBase"/>.</remarks> 93 /// <param name="op">The operator to remove.</param> 66 94 public void RemoveOperator(IOperator op) { 67 95 if(subOperators.Contains(op)) { … … 71 99 } 72 100 101 /// <summary> 102 /// Empties the list of sub-operators. 103 /// </summary> 73 104 public void Clear() { 74 105 subOperators.Clear(); 75 106 } 76 107 108 /// <summary> 109 /// Checks whether the given element fulfills the current constraint. 110 /// </summary> 111 /// <param name="data">The item to check.</param> 112 /// <returns><c>true</c> if the constraint could be fulfilled, <c>false</c> otherwise.</returns> 77 113 public override bool Check(IItem data) { 78 114 IOperator op = data as IOperator; … … 85 121 } 86 122 123 /// <summary> 124 /// Clones the current instance (deep clone). 125 /// </summary> 126 /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class 127 /// <see cref="Auxiliary"/>.</remarks> 128 /// <param name="clonedObjects">Dictionary of all already clone objects. (Needed to avoid cycles.)</param> 129 /// <returns>The cloned object as <see cref="SubOperatorTypeConstraint"/>.</returns> 87 130 public override object Clone(IDictionary<Guid, object> clonedObjects) { 88 131 SubOperatorTypeConstraint clone = new SubOperatorTypeConstraint(); … … 95 138 } 96 139 140 /// <summary> 141 /// Creates a new instance of <see cref="SubOperatorsTypeConstraintView"/> to represent the current 142 /// instance visually. 143 /// </summary> 144 /// <returns>The created view as <see cref="SubOperatorsTypeConstraintView"/>.</returns> 97 145 public override IView CreateView() { 98 146 return new SubOperatorsTypeConstraintView(this); … … 100 148 101 149 #region persistence 150 /// <summary> 151 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 152 /// </summary> 153 /// <remarks>The index and the list of sub-operators are saved as child nodes with tag names 154 /// <c>SubOperatorIndex</c> and <c>AllowedSubOperators</c>.</remarks> 155 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 156 /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param> 157 /// <param name="persistedObjects">The dictionary of all already persisted objects. 158 /// (Needed to avoid cycles.)</param> 159 /// <returns>The saved <see cref="XmlNode"/>.</returns> 102 160 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 103 161 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 113 171 } 114 172 173 /// <summary> 174 /// Loads the persisted constraint from the specified <paramref name="node"/>. 175 /// </summary> 176 /// <remarks>The constraint must be saved in a specific way, see <see cref="GetXmlNode"/> for 177 /// more information.</remarks> 178 /// <param name="node">The <see cref="XmlNode"/> where the instance is saved.</param> 179 /// <param name="restoredObjects">The dictionary of all already restored objects. 180 /// (Needed to avoid cycles.)</param> 115 181 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 116 182 base.Populate(node, restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.