Changeset 3048 for trunk/sources/HeuristicLab.Data
- Timestamp:
- 03/15/10 23:49:54 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Data/3.3
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data/3.3/BoolArray.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("BoolArray Data", "Represents an array of boolean values.")]27 [Item("BoolArray", "Represents an array of boolean values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class BoolArray Data : ValueTypeArrayData<bool>, IStringConvertibleArrayData{31 public BoolArray Data() : base() { }32 public BoolArray Data(int length) : base(length) { }33 public BoolArray Data(bool[] elements) : base(elements) { }34 private BoolArray Data(BoolArrayDataelements) : base(elements) { }30 public sealed class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray { 31 public BoolArray() : base() { } 32 public BoolArray(int length) : base(length) { } 33 public BoolArray(bool[] elements) : base(elements) { } 34 private BoolArray(BoolArray elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 BoolArray Data clone = new BoolArrayData(this);37 BoolArray clone = new BoolArray(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleArray DataMembers43 int IStringConvertibleArray Data.Length {42 #region IStringConvertibleArray Members 43 int IStringConvertibleArray.Length { 44 44 get { return Length; } 45 45 set { Length = value; } 46 46 } 47 47 48 bool IStringConvertibleArray Data.Validate(string value, out string errorMessage) {48 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 49 49 bool val; 50 50 bool valid = bool.TryParse(value, out val); … … 59 59 return valid; 60 60 } 61 string IStringConvertibleArray Data.GetValue(int index) {61 string IStringConvertibleArray.GetValue(int index) { 62 62 return this[index].ToString(); 63 63 } 64 bool IStringConvertibleArray Data.SetValue(string value, int index) {64 bool IStringConvertibleArray.SetValue(string value, int index) { 65 65 bool val; 66 66 if (bool.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/BoolMatrix.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("BoolMatrix Data", "Represents a matrix of boolean values.")]27 [Item("BoolMatrix", "Represents a matrix of boolean values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class BoolMatrix Data : ValueTypeMatrixData<bool>, IStringConvertibleMatrixData{31 public BoolMatrix Data() : base() { }32 public BoolMatrix Data(int rows, int columns) : base(rows, columns) { }33 public BoolMatrix Data(bool[,] elements) : base(elements) { }34 private BoolMatrix Data(BoolMatrixDataelements) : base(elements) { }30 public sealed class BoolMatrix : ValueTypeMatrix<bool>, IStringConvertibleMatrix { 31 public BoolMatrix() : base() { } 32 public BoolMatrix(int rows, int columns) : base(rows, columns) { } 33 public BoolMatrix(bool[,] elements) : base(elements) { } 34 private BoolMatrix(BoolMatrix elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 BoolMatrix Data clone = new BoolMatrixData(this);37 BoolMatrix clone = new BoolMatrix(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleMatrix DataMembers43 int IStringConvertibleMatrix Data.Rows {42 #region IStringConvertibleMatrix Members 43 int IStringConvertibleMatrix.Rows { 44 44 get { return Rows; } 45 45 set { Rows = value; } 46 46 } 47 int IStringConvertibleMatrix Data.Columns {47 int IStringConvertibleMatrix.Columns { 48 48 get { return Columns; } 49 49 set { Columns = value; } 50 50 } 51 51 52 bool IStringConvertibleMatrix Data.Validate(string value, out string errorMessage) {52 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 53 53 bool val; 54 54 bool valid = bool.TryParse(value, out val); … … 63 63 return valid; 64 64 } 65 string IStringConvertibleMatrix Data.GetValue(int rowIndex, int columIndex) {65 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 66 66 return this[rowIndex, columIndex].ToString(); 67 67 } 68 bool IStringConvertibleMatrix Data.SetValue(string value, int rowIndex, int columnIndex) {68 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 69 69 bool val; 70 70 if (bool.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/BoolValue.cs
r3047 r3048 26 26 27 27 namespace HeuristicLab.Data { 28 [Item("Bool Data", "Represents a boolean value.")]28 [Item("BoolValue", "Represents a boolean value.")] 29 29 [Creatable("Test")] 30 30 [StorableClass] 31 public sealed class Bool Data : ValueTypeData<bool>, IComparable, IStringConvertibleData{32 public Bool Data() : base() { }33 public Bool Data(bool value) : base(value) { }31 public sealed class BoolValue : ValueTypeValue<bool>, IComparable, IStringConvertibleValue { 32 public BoolValue() : base() { } 33 public BoolValue(bool value) : base(value) { } 34 34 35 35 public override IDeepCloneable Clone(Cloner cloner) { 36 Bool Data clone = new BoolData(Value);36 BoolValue clone = new BoolValue(Value); 37 37 cloner.RegisterClonedObject(this, clone); 38 38 return clone; … … 40 40 41 41 public int CompareTo(object obj) { 42 Bool Data other = obj as BoolData;42 BoolValue other = obj as BoolValue; 43 43 if (other != null) 44 44 return Value.CompareTo(other.Value); … … 47 47 } 48 48 49 #region IStringConvertible DataMembers50 bool IStringConvertible Data.Validate(string value, out string errorMessage) {49 #region IStringConvertibleValue Members 50 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 51 51 bool val; 52 52 bool valid = bool.TryParse(value, out val); … … 61 61 return valid; 62 62 } 63 string IStringConvertible Data.GetValue() {63 string IStringConvertibleValue.GetValue() { 64 64 return Value.ToString(); 65 65 } 66 bool IStringConvertible Data.SetValue(string value) {66 bool IStringConvertibleValue.SetValue(string value) { 67 67 bool val; 68 68 if (bool.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/Comparison.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("Comparison Data", "Represents a comparison.")]27 [Item("Comparison", "Represents a comparison.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class Comparison Data : ValueTypeData<Comparison>, IComparable {31 public Comparison Data() : base() { }32 public Comparison Data(Comparisonvalue) : base(value) { }30 public sealed class Comparison : ValueTypeValue<ComparisonType>, IComparable { 31 public Comparison() : base() { } 32 public Comparison(ComparisonType value) : base(value) { } 33 33 34 34 public override IDeepCloneable Clone(Cloner cloner) { 35 Comparison Data clone = new ComparisonData(Value);35 Comparison clone = new Comparison(Value); 36 36 cloner.RegisterClonedObject(this, clone); 37 37 return clone; … … 39 39 40 40 public int CompareTo(object obj) { 41 Comparison Data other = obj as ComparisonData;41 Comparison other = obj as Comparison; 42 42 if (other != null) 43 43 return Value.CompareTo(other.Value); -
trunk/sources/HeuristicLab.Data/3.3/ComparisonType.cs
r3047 r3048 21 21 22 22 namespace HeuristicLab.Data { 23 public enum Comparison {23 public enum ComparisonType { 24 24 Less, 25 25 LessOrEqual, -
trunk/sources/HeuristicLab.Data/3.3/DateTimeValue.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("DateTime Data", "Represents a date and time value.")]27 [Item("DateTimeValue", "Represents a date and time value.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class DateTime Data : ValueTypeData<DateTime>, IComparable, IStringConvertibleData{31 public DateTime Data() : base() { }32 public DateTime Data(DateTime value) : base(value) { }30 public sealed class DateTimeValue : ValueTypeValue<DateTime>, IComparable, IStringConvertibleValue { 31 public DateTimeValue() : base() { } 32 public DateTimeValue(DateTime value) : base(value) { } 33 33 34 34 public override IDeepCloneable Clone(Cloner cloner) { 35 DateTime Data clone = new DateTimeData(Value);35 DateTimeValue clone = new DateTimeValue(Value); 36 36 cloner.RegisterClonedObject(this, clone); 37 37 return clone; … … 43 43 44 44 public int CompareTo(object obj) { 45 DateTime Data other = obj as DateTimeData;45 DateTimeValue other = obj as DateTimeValue; 46 46 if (other != null) 47 47 return Value.CompareTo(other.Value); … … 50 50 } 51 51 52 #region IStringConvertible DataMembers53 bool IStringConvertible Data.Validate(string value, out string errorMessage) {52 #region IStringConvertibleValue Members 53 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 54 54 DateTime val; 55 55 bool valid = DateTime.TryParse(value, out val); … … 57 57 return valid; 58 58 } 59 string IStringConvertible Data.GetValue() {59 string IStringConvertibleValue.GetValue() { 60 60 return Value.ToString("o"); // round-trip format 61 61 } 62 bool IStringConvertible Data.SetValue(string value) {62 bool IStringConvertibleValue.SetValue(string value) { 63 63 DateTime val; 64 64 if (DateTime.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/DoubleArray.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("DoubleArray Data", "Represents an array of double values.")]27 [Item("DoubleArray", "Represents an array of double values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class DoubleArray Data : ValueTypeArrayData<double>, IStringConvertibleArrayData{31 public DoubleArray Data() : base() { }32 public DoubleArray Data(int length) : base(length) { }33 public DoubleArray Data(double[] elements) : base(elements) { }34 private DoubleArray Data(DoubleArrayDataelements) : base(elements) { }30 public sealed class DoubleArray : ValueTypeArray<double>, IStringConvertibleArray { 31 public DoubleArray() : base() { } 32 public DoubleArray(int length) : base(length) { } 33 public DoubleArray(double[] elements) : base(elements) { } 34 private DoubleArray(DoubleArray elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 DoubleArray Data clone = new DoubleArrayData(this);37 DoubleArray clone = new DoubleArray(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleArray DataMembers43 int IStringConvertibleArray Data.Length {42 #region IStringConvertibleArray Members 43 int IStringConvertibleArray.Length { 44 44 get { return Length; } 45 45 set { Length = value; } 46 46 } 47 47 48 bool IStringConvertibleArray Data.Validate(string value, out string errorMessage) {48 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 49 49 double val; 50 50 bool valid = double.TryParse(value, out val); … … 59 59 return valid; 60 60 } 61 string IStringConvertibleArray Data.GetValue(int index) {61 string IStringConvertibleArray.GetValue(int index) { 62 62 return this[index].ToString(); 63 63 } 64 bool IStringConvertibleArray Data.SetValue(string value, int index) {64 bool IStringConvertibleArray.SetValue(string value, int index) { 65 65 double val; 66 66 if (double.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/DoubleMatrix.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("DoubleMatrix Data", "Represents a matrix of double values.")]27 [Item("DoubleMatrix", "Represents a matrix of double values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class DoubleMatrix Data : ValueTypeMatrixData<double>, IStringConvertibleMatrixData{31 public DoubleMatrix Data() : base() { }32 public DoubleMatrix Data(int rows, int columns) : base(rows, columns) { }33 public DoubleMatrix Data(double[,] elements) : base(elements) { }34 private DoubleMatrix Data(DoubleMatrixDataelements) : base(elements) { }30 public sealed class DoubleMatrix : ValueTypeMatrix<double>, IStringConvertibleMatrix { 31 public DoubleMatrix() : base() { } 32 public DoubleMatrix(int rows, int columns) : base(rows, columns) { } 33 public DoubleMatrix(double[,] elements) : base(elements) { } 34 private DoubleMatrix(DoubleMatrix elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 DoubleMatrix Data clone = new DoubleMatrixData(this);37 DoubleMatrix clone = new DoubleMatrix(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleMatrix DataMembers43 int IStringConvertibleMatrix Data.Rows {42 #region IStringConvertibleMatrix Members 43 int IStringConvertibleMatrix.Rows { 44 44 get { return Rows; } 45 45 set { Rows = value; } 46 46 } 47 int IStringConvertibleMatrix Data.Columns {47 int IStringConvertibleMatrix.Columns { 48 48 get { return Columns; } 49 49 set { Columns = value; } 50 50 } 51 51 52 bool IStringConvertibleMatrix Data.Validate(string value, out string errorMessage) {52 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 53 53 double val; 54 54 bool valid = double.TryParse(value, out val); … … 63 63 return valid; 64 64 } 65 string IStringConvertibleMatrix Data.GetValue(int rowIndex, int columIndex) {65 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 66 66 return this[rowIndex, columIndex].ToString(); 67 67 } 68 bool IStringConvertibleMatrix Data.SetValue(string value, int rowIndex, int columnIndex) {68 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 69 69 double val; 70 70 if (double.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/DoubleValue.cs
r3047 r3048 26 26 27 27 namespace HeuristicLab.Data { 28 [Item("Double Data", "Represents a double value.")]28 [Item("DoubleValue", "Represents a double value.")] 29 29 [Creatable("Test")] 30 30 [StorableClass] 31 public sealed class Double Data : ValueTypeData<double>, IComparable, IStringConvertibleData{32 public Double Data() : base() { }33 public Double Data(double value) : base(value) { }31 public sealed class DoubleValue : ValueTypeValue<double>, IComparable, IStringConvertibleValue { 32 public DoubleValue() : base() { } 33 public DoubleValue(double value) : base(value) { } 34 34 35 35 public override IDeepCloneable Clone(Cloner cloner) { 36 Double Data clone = new DoubleData(Value);36 DoubleValue clone = new DoubleValue(Value); 37 37 cloner.RegisterClonedObject(this, clone); 38 38 return clone; … … 44 44 45 45 public int CompareTo(object obj) { 46 Double Data other = obj as DoubleData;46 DoubleValue other = obj as DoubleValue; 47 47 if (other != null) 48 48 return Value.CompareTo(other.Value); … … 51 51 } 52 52 53 #region IStringConvertible DataMembers54 bool IStringConvertible Data.Validate(string value, out string errorMessage) {53 #region IStringConvertibleValue Members 54 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 55 55 double val; 56 56 bool valid = double.TryParse(value, out val); … … 65 65 return valid; 66 66 } 67 string IStringConvertible Data.GetValue() {67 string IStringConvertibleValue.GetValue() { 68 68 return Value.ToString("r"); // round-trip format 69 69 } 70 bool IStringConvertible Data.SetValue(string value) {70 bool IStringConvertibleValue.SetValue(string value) { 71 71 double val; 72 72 if (double.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/IStringConvertibleArray.cs
r3047 r3048 24 24 25 25 namespace HeuristicLab.Data { 26 public interface IStringConvertibleArray Data{26 public interface IStringConvertibleArray { 27 27 int Length { get; set; } 28 28 -
trunk/sources/HeuristicLab.Data/3.3/IStringConvertibleMatrix.cs
r3047 r3048 24 24 25 25 namespace HeuristicLab.Data { 26 public interface IStringConvertibleMatrix Data{26 public interface IStringConvertibleMatrix { 27 27 int Rows { get; set; } 28 28 int Columns { get; set; } -
trunk/sources/HeuristicLab.Data/3.3/IStringConvertibleValue.cs
r3047 r3048 23 23 24 24 namespace HeuristicLab.Data { 25 public interface IStringConvertible Data{25 public interface IStringConvertibleValue { 26 26 bool Validate(string value, out string errorMessage); 27 27 string GetValue(); -
trunk/sources/HeuristicLab.Data/3.3/IntArray.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("IntArray Data", "Represents an array of integer values.")]27 [Item("IntArray", "Represents an array of integer values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class IntArray Data : ValueTypeArrayData<int>, IStringConvertibleArrayData{31 public IntArray Data() : base() { }32 public IntArray Data(int length) : base(length) { }33 public IntArray Data(int[] elements) : base(elements) { }34 private IntArray Data(IntArrayDataelements) : base(elements) { }30 public sealed class IntArray : ValueTypeArray<int>, IStringConvertibleArray { 31 public IntArray() : base() { } 32 public IntArray(int length) : base(length) { } 33 public IntArray(int[] elements) : base(elements) { } 34 private IntArray(IntArray elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 IntArray Data clone = new IntArrayData(this);37 IntArray clone = new IntArray(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleArray DataMembers43 int IStringConvertibleArray Data.Length {42 #region IStringConvertibleArray Members 43 int IStringConvertibleArray.Length { 44 44 get { return Length; } 45 45 set { Length = value; } 46 46 } 47 47 48 bool IStringConvertibleArray Data.Validate(string value, out string errorMessage) {48 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 49 49 int val; 50 50 bool valid = int.TryParse(value, out val); … … 59 59 return valid; 60 60 } 61 string IStringConvertibleArray Data.GetValue(int index) {61 string IStringConvertibleArray.GetValue(int index) { 62 62 return this[index].ToString(); 63 63 } 64 bool IStringConvertibleArray Data.SetValue(string value, int index) {64 bool IStringConvertibleArray.SetValue(string value, int index) { 65 65 int val; 66 66 if (int.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/IntMatrix.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("IntMatrix Data", "Represents a matrix of integer values.")]27 [Item("IntMatrix", "Represents a matrix of integer values.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class IntMatrix Data : ValueTypeMatrixData<int>, IStringConvertibleMatrixData{31 public IntMatrix Data() : base() { }32 public IntMatrix Data(int rows, int columns) : base(rows, columns) { }33 public IntMatrix Data(int[,] elements) : base(elements) { }34 private IntMatrix Data(IntMatrixDataelements) : base(elements) { }30 public sealed class IntMatrix : ValueTypeMatrix<int>, IStringConvertibleMatrix { 31 public IntMatrix() : base() { } 32 public IntMatrix(int rows, int columns) : base(rows, columns) { } 33 public IntMatrix(int[,] elements) : base(elements) { } 34 private IntMatrix(IntMatrix elements) : base(elements) { } 35 35 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 IntMatrix Data clone = new IntMatrixData(this);37 IntMatrix clone = new IntMatrix(this); 38 38 cloner.RegisterClonedObject(this, clone); 39 39 return clone; 40 40 } 41 41 42 #region IStringConvertibleMatrix DataMembers43 int IStringConvertibleMatrix Data.Rows {42 #region IStringConvertibleMatrix Members 43 int IStringConvertibleMatrix.Rows { 44 44 get { return Rows; } 45 45 set { Rows = value; } 46 46 } 47 int IStringConvertibleMatrix Data.Columns {47 int IStringConvertibleMatrix.Columns { 48 48 get { return Columns; } 49 49 set { Columns = value; } 50 50 } 51 51 52 bool IStringConvertibleMatrix Data.Validate(string value, out string errorMessage) {52 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 53 53 int val; 54 54 bool valid = int.TryParse(value, out val); … … 63 63 return valid; 64 64 } 65 string IStringConvertibleMatrix Data.GetValue(int rowIndex, int columIndex) {65 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 66 66 return this[rowIndex, columIndex].ToString(); 67 67 } 68 bool IStringConvertibleMatrix Data.SetValue(string value, int rowIndex, int columnIndex) {68 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 69 69 int val; 70 70 if (int.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/IntValue.cs
r3047 r3048 26 26 27 27 namespace HeuristicLab.Data { 28 [Item("Int Data", "Represents an integer value.")]28 [Item("IntValue", "Represents an integer value.")] 29 29 [Creatable("Test")] 30 30 [StorableClass] 31 public sealed class Int Data : ValueTypeData<int>, IComparable, IStringConvertibleData{32 public Int Data() : base() { }33 public Int Data(int value) : base(value) { }31 public sealed class IntValue : ValueTypeValue<int>, IComparable, IStringConvertibleValue { 32 public IntValue() : base() { } 33 public IntValue(int value) : base(value) { } 34 34 35 35 public override IDeepCloneable Clone(Cloner cloner) { 36 Int Data clone = new IntData(Value);36 IntValue clone = new IntValue(Value); 37 37 cloner.RegisterClonedObject(this, clone); 38 38 return clone; … … 40 40 41 41 public int CompareTo(object obj) { 42 Int Data other = obj as IntData;42 IntValue other = obj as IntValue; 43 43 if (other != null) 44 44 return Value.CompareTo(other.Value); … … 47 47 } 48 48 49 #region IStringConvertible DataMembers50 bool IStringConvertible Data.Validate(string value, out string errorMessage) {49 #region IStringConvertibleValue Members 50 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 51 51 int val; 52 52 bool valid = int.TryParse(value, out val); … … 61 61 return valid; 62 62 } 63 string IStringConvertible Data.GetValue() {63 string IStringConvertibleValue.GetValue() { 64 64 return Value.ToString(); 65 65 } 66 bool IStringConvertible Data.SetValue(string value) {66 bool IStringConvertibleValue.SetValue(string value) { 67 67 int val; 68 68 if (int.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/StringArray.cs
r3047 r3048 28 28 29 29 namespace HeuristicLab.Data { 30 [Item("StringArray Data", "Represents an array of strings.")]30 [Item("StringArray", "Represents an array of strings.")] 31 31 [Creatable("Test")] 32 32 [StorableClass] 33 public sealed class StringArray Data : Item, IEnumerable, IStringConvertibleArrayData{33 public sealed class StringArray : Item, IEnumerable, IStringConvertibleArray { 34 34 [Storable] 35 35 private string[] array; … … 56 56 } 57 57 58 public StringArray Data() {58 public StringArray() { 59 59 array = new string[0]; 60 60 } 61 public StringArray Data(int length) {61 public StringArray(int length) { 62 62 array = new string[length]; 63 63 for (int i = 0; i < array.Length; i++) 64 64 array[i] = string.Empty; 65 65 } 66 public StringArray Data(string[] elements) {66 public StringArray(string[] elements) { 67 67 if (elements == null) throw new ArgumentNullException(); 68 68 array = new string[elements.Length]; … … 70 70 array[i] = elements[i] == null ? string.Empty : elements[i]; 71 71 } 72 private StringArray Data(StringArrayDataelements) {72 private StringArray(StringArray elements) { 73 73 if (elements == null) throw new ArgumentNullException(); 74 74 array = (string[])elements.array.Clone(); … … 76 76 77 77 public override IDeepCloneable Clone(Cloner cloner) { 78 StringArray Data clone = new StringArrayData(this);78 StringArray clone = new StringArray(this); 79 79 cloner.RegisterClonedObject(this, clone); 80 80 return clone; … … 97 97 } 98 98 99 #region IStringConvertibleArray DataMembers100 int IStringConvertibleArray Data.Length {99 #region IStringConvertibleArray Members 100 int IStringConvertibleArray.Length { 101 101 get { return Length; } 102 102 set { Length = value; } 103 103 } 104 104 105 bool IStringConvertibleArray Data.Validate(string value, out string errorMessage) {105 bool IStringConvertibleArray.Validate(string value, out string errorMessage) { 106 106 if (value == null) { 107 107 errorMessage = "Invalid Value (string must not be null)"; … … 112 112 } 113 113 } 114 string IStringConvertibleArray Data.GetValue(int index) {114 string IStringConvertibleArray.GetValue(int index) { 115 115 return this[index]; 116 116 } 117 bool IStringConvertibleArray Data.SetValue(string value, int index) {117 bool IStringConvertibleArray.SetValue(string value, int index) { 118 118 if (value != null) { 119 119 this[index] = value; -
trunk/sources/HeuristicLab.Data/3.3/StringMatrix.cs
r3047 r3048 28 28 29 29 namespace HeuristicLab.Data { 30 [Item("StringMatrix Data", "Represents a matrix of strings.")]30 [Item("StringMatrix", "Represents a matrix of strings.")] 31 31 [Creatable("Test")] 32 32 [StorableClass] 33 public sealed class StringMatrix Data : Item, IEnumerable, IStringConvertibleMatrixData{33 public sealed class StringMatrix : Item, IEnumerable, IStringConvertibleMatrix { 34 34 [Storable] 35 35 private string[,] array; … … 70 70 } 71 71 72 public StringMatrix Data() {72 public StringMatrix() { 73 73 array = new string[0, 0]; 74 74 } 75 public StringMatrix Data(int rows, int columns) {75 public StringMatrix(int rows, int columns) { 76 76 array = new string[rows, columns]; 77 77 for (int i = 0; i < array.GetLength(0); i++) { … … 80 80 } 81 81 } 82 public StringMatrix Data(string[,] elements) {82 public StringMatrix(string[,] elements) { 83 83 if (elements == null) throw new ArgumentNullException(); 84 84 array = new string[elements.GetLength(0), elements.GetLength(1)]; … … 88 88 } 89 89 } 90 private StringMatrix Data(StringMatrixDataelements) {90 private StringMatrix(StringMatrix elements) { 91 91 if (elements == null) throw new ArgumentNullException(); 92 92 array = (string[,])elements.array.Clone(); … … 94 94 95 95 public override IDeepCloneable Clone(Cloner cloner) { 96 StringMatrix Data clone = new StringMatrixData(this);96 StringMatrix clone = new StringMatrix(this); 97 97 cloner.RegisterClonedObject(this, clone); 98 98 return clone; … … 118 118 } 119 119 120 #region IStringConvertibleMatrix DataMembers121 int IStringConvertibleMatrix Data.Rows {120 #region IStringConvertibleMatrix Members 121 int IStringConvertibleMatrix.Rows { 122 122 get { return Rows; } 123 123 set { Rows = value; } 124 124 } 125 int IStringConvertibleMatrix Data.Columns {125 int IStringConvertibleMatrix.Columns { 126 126 get { return Columns; } 127 127 set { Columns = value; } 128 128 } 129 129 130 bool IStringConvertibleMatrix Data.Validate(string value, out string errorMessage) {130 bool IStringConvertibleMatrix.Validate(string value, out string errorMessage) { 131 131 if (value == null) { 132 132 errorMessage = "Invalid Value (string must not be null)"; … … 137 137 } 138 138 } 139 string IStringConvertibleMatrix Data.GetValue(int rowIndex, int columIndex) {139 string IStringConvertibleMatrix.GetValue(int rowIndex, int columIndex) { 140 140 return this[rowIndex, columIndex]; 141 141 } 142 bool IStringConvertibleMatrix Data.SetValue(string value, int rowIndex, int columnIndex) {142 bool IStringConvertibleMatrix.SetValue(string value, int rowIndex, int columnIndex) { 143 143 if (value != null) { 144 144 this[rowIndex, columnIndex] = value; -
trunk/sources/HeuristicLab.Data/3.3/StringValue.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("String Data", "Represents a string.")]27 [Item("StringValue", "Represents a string.")] 28 28 [Creatable("Test")] 29 29 [StorableClass] 30 public sealed class String Data : Item, IComparable, IStringConvertibleData{30 public sealed class StringValue : Item, IComparable, IStringConvertibleValue { 31 31 [Storable] 32 32 private string value; … … 43 43 } 44 44 45 public String Data() {45 public StringValue() { 46 46 this.value = string.Empty; 47 47 } 48 public String Data(string value) {48 public StringValue(string value) { 49 49 this.value = value != null ? value : string.Empty; 50 50 } 51 51 52 52 public override IDeepCloneable Clone(Cloner cloner) { 53 String Data clone = new StringData(Value);53 StringValue clone = new StringValue(Value); 54 54 cloner.RegisterClonedObject(this, clone); 55 55 return clone; … … 61 61 62 62 public int CompareTo(object obj) { 63 String Data other = obj as StringData;63 StringValue other = obj as StringValue; 64 64 if (other != null) 65 65 return Value.CompareTo(other.Value); … … 75 75 } 76 76 77 #region IStringConvertible DataMembers78 bool IStringConvertible Data.Validate(string value, out string errorMessage) {77 #region IStringConvertibleValue Members 78 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 79 79 if (value == null) { 80 80 errorMessage = "Invalid Value (string must not be null)"; … … 85 85 } 86 86 } 87 string IStringConvertible Data.GetValue() {87 string IStringConvertibleValue.GetValue() { 88 88 return Value; 89 89 } 90 bool IStringConvertible Data.SetValue(string value) {90 bool IStringConvertibleValue.SetValue(string value) { 91 91 if (value != null) { 92 92 Value = value; -
trunk/sources/HeuristicLab.Data/3.3/TimeSpanValue.cs
r3047 r3048 26 26 27 27 namespace HeuristicLab.Data { 28 [Item("TimeSpan Data", "Represents a duration of time.")]28 [Item("TimeSpanValue", "Represents a duration of time.")] 29 29 [Creatable("Test")] 30 30 [StorableClass] 31 public sealed class TimeSpan Data : ValueTypeData<TimeSpan>, IComparable, IStringConvertibleData{32 public TimeSpan Data() : base() { }33 public TimeSpan Data(TimeSpan value) : base(value) { }31 public sealed class TimeSpanValue : ValueTypeValue<TimeSpan>, IComparable, IStringConvertibleValue { 32 public TimeSpanValue() : base() { } 33 public TimeSpanValue(TimeSpan value) : base(value) { } 34 34 35 35 public override IDeepCloneable Clone(Cloner cloner) { 36 TimeSpan Data clone = new TimeSpanData(Value);36 TimeSpanValue clone = new TimeSpanValue(Value); 37 37 cloner.RegisterClonedObject(this, clone); 38 38 return clone; … … 40 40 41 41 public int CompareTo(object obj) { 42 TimeSpan Data other = obj as TimeSpanData;42 TimeSpanValue other = obj as TimeSpanValue; 43 43 if (other != null) 44 44 return Value.CompareTo(other.Value); … … 47 47 } 48 48 49 #region IStringConvertible DataMembers50 bool IStringConvertible Data.Validate(string value, out string errorMessage) {49 #region IStringConvertibleValue Members 50 bool IStringConvertibleValue.Validate(string value, out string errorMessage) { 51 51 TimeSpan val; 52 52 bool valid = TimeSpan.TryParse(value, out val); … … 61 61 return valid; 62 62 } 63 string IStringConvertible Data.GetValue() {63 string IStringConvertibleValue.GetValue() { 64 64 return Value.ToString(); 65 65 } 66 bool IStringConvertible Data.SetValue(string value) {66 bool IStringConvertibleValue.SetValue(string value) { 67 67 TimeSpan val; 68 68 if (TimeSpan.TryParse(value, out val)) { -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeArray.cs
r3047 r3048 28 28 29 29 namespace HeuristicLab.Data { 30 [Item("ValueTypeArray Data<T>", "A base class for representing arrays of value types.")]30 [Item("ValueTypeArray<T>", "A base class for representing arrays of value types.")] 31 31 [StorableClass] 32 public class ValueTypeArray Data<T> : Item, IEnumerable where T : struct {32 public class ValueTypeArray<T> : Item, IEnumerable where T : struct { 33 33 [Storable] 34 34 private T[] array; … … 53 53 } 54 54 55 public ValueTypeArray Data() {55 public ValueTypeArray() { 56 56 array = new T[0]; 57 57 } 58 public ValueTypeArray Data(int length) {58 public ValueTypeArray(int length) { 59 59 array = new T[length]; 60 60 } 61 public ValueTypeArray Data(T[] elements) {61 public ValueTypeArray(T[] elements) { 62 62 if (elements == null) throw new ArgumentNullException(); 63 63 array = (T[])elements.Clone(); 64 64 } 65 protected ValueTypeArray Data(ValueTypeArrayData<T> elements) {65 protected ValueTypeArray(ValueTypeArray<T> elements) { 66 66 if (elements == null) throw new ArgumentNullException(); 67 67 array = (T[])elements.array.Clone(); … … 69 69 70 70 public override IDeepCloneable Clone(Cloner cloner) { 71 ValueTypeArray Data<T> clone = (ValueTypeArrayData<T>)base.Clone(cloner);71 ValueTypeArray<T> clone = (ValueTypeArray<T>)base.Clone(cloner); 72 72 clone.array = (T[])array.Clone(); 73 73 return clone; -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r3047 r3048 28 28 29 29 namespace HeuristicLab.Data { 30 [Item("ValueTypeMatrix Data<T>", "A base class for representing matrices of value types.")]30 [Item("ValueTypeMatrix<T>", "A base class for representing matrices of value types.")] 31 31 [StorableClass] 32 public class ValueTypeMatrix Data<T> : Item, IEnumerable where T : struct {32 public class ValueTypeMatrix<T> : Item, IEnumerable where T : struct { 33 33 [Storable] 34 34 private T[,] array; … … 67 67 } 68 68 69 public ValueTypeMatrix Data() {69 public ValueTypeMatrix() { 70 70 array = new T[0, 0]; 71 71 } 72 public ValueTypeMatrix Data(int rows, int columns) {72 public ValueTypeMatrix(int rows, int columns) { 73 73 array = new T[rows, columns]; 74 74 } 75 public ValueTypeMatrix Data(T[,] elements) {75 public ValueTypeMatrix(T[,] elements) { 76 76 if (elements == null) throw new ArgumentNullException(); 77 77 array = (T[,])elements.Clone(); 78 78 } 79 protected ValueTypeMatrix Data(ValueTypeMatrixData<T> elements) {79 protected ValueTypeMatrix(ValueTypeMatrix<T> elements) { 80 80 if (elements == null) throw new ArgumentNullException(); 81 81 array = (T[,])elements.array.Clone(); … … 83 83 84 84 public override IDeepCloneable Clone(Cloner cloner) { 85 ValueTypeMatrix Data<T> clone = (ValueTypeMatrixData<T>)base.Clone(cloner);85 ValueTypeMatrix<T> clone = (ValueTypeMatrix<T>)base.Clone(cloner); 86 86 clone.array = (T[,])array.Clone(); 87 87 return clone; -
trunk/sources/HeuristicLab.Data/3.3/ValueTypeValue.cs
r3047 r3048 25 25 26 26 namespace HeuristicLab.Data { 27 [Item("ValueType Data<T>", "A base class for representing value types.")]27 [Item("ValueTypeValue<T>", "A base class for representing value types.")] 28 28 [StorableClass] 29 public class ValueType Data<T> : Item where T : struct {29 public class ValueTypeValue<T> : Item where T : struct { 30 30 [Storable] 31 31 private T value; … … 40 40 } 41 41 42 public ValueType Data() {42 public ValueTypeValue() { 43 43 this.value = default(T); 44 44 } 45 public ValueType Data(T value) {45 public ValueTypeValue(T value) { 46 46 this.value = value; 47 47 } 48 48 49 49 public override IDeepCloneable Clone(Cloner cloner) { 50 ValueType Data<T> clone = (ValueTypeData<T>)base.Clone(cloner);50 ValueTypeValue<T> clone = (ValueTypeValue<T>)base.Clone(cloner); 51 51 clone.value = value; 52 52 return clone;
Note: See TracChangeset
for help on using the changeset viewer.