Changeset 2974 for trunk/sources/HeuristicLab.Encodings.Permutation
- Timestamp:
- 03/09/10 03:57:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.Permutation/3.3/Permutation.cs
r2906 r2974 31 31 [Item("Permutation", "Represents a permutation of integer values.")] 32 32 [Creatable("Test")] 33 public sealed class Permutation : ValueTypeArrayData<int>, IStringConvertible MatrixData {33 public sealed class Permutation : ValueTypeArrayData<int>, IStringConvertibleArrayData { 34 34 public Permutation() : base() { } 35 35 public Permutation(int length) … … 85 85 } 86 86 87 #region IStringConvertibleMatrixData Members 88 StringConvertibleArrayDataDimensions IStringConvertibleMatrixData.Dimensions { 89 get { return StringConvertibleArrayDataDimensions.Rows; } 90 } 91 int IStringConvertibleMatrixData.Rows { 87 #region IStringConvertibleArrayData Members 88 int IStringConvertibleArrayData.Length { 92 89 get { return Length; } 93 90 set { Length = value; } 94 91 } 95 int IStringConvertibleMatrixData.Columns {96 get { return 1; }97 set { throw new NotSupportedException("The number of columns cannot be changed."); }98 }99 92 100 bool IStringConvertible MatrixData.Validate(string value, out string errorMessage) {93 bool IStringConvertibleArrayData.Validate(string value, out string errorMessage) { 101 94 int val; 102 95 bool valid = int.TryParse(value, out val); … … 111 104 return valid; 112 105 } 113 string IStringConvertible MatrixData.GetValue(int rowIndex, int columIndex) {114 return this[ rowIndex].ToString();106 string IStringConvertibleArrayData.GetValue(int index) { 107 return this[index].ToString(); 115 108 } 116 bool IStringConvertible MatrixData.SetValue(string value, int rowIndex, int columnIndex) {109 bool IStringConvertibleArrayData.SetValue(string value, int index) { 117 110 int val; 118 111 if (int.TryParse(value, out val)) { 119 this[ rowIndex] = val;112 this[index] = val; 120 113 return true; 121 114 } else { … … 123 116 } 124 117 } 125 event EventHandler<EventArgs<int, int>> IStringConvertibleMatrixData.ItemChanged {126 add { base.ItemChanged += value; }127 remove { base.ItemChanged -= value; }128 }129 event EventHandler IStringConvertibleMatrixData.Reset {130 add { base.Reset += value; }131 remove { base.Reset -= value; }132 }133 118 #endregion 134 119 }
Note: See TracChangeset
for help on using the changeset viewer.