Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/16 14:57:02 (8 years ago)
Author:
mkommend
Message:

#2589: Added resizable option in ValueTypeArray and refactored the array implementations and interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/3.3/DoubleArray.cs

    r12432 r13695  
    2828  [Item("DoubleArray", "Represents an array of double values.")]
    2929  [StorableClass]
    30   public class DoubleArray : ValueTypeArray<double>, IStringConvertibleArray {
     30  public class DoubleArray : StringConvertibleArray<double> {
    3131    [StorableConstructor]
    3232    protected DoubleArray(bool deserializing) : base(deserializing) { }
     
    4242    }
    4343
    44     protected virtual bool Validate(string value, out string errorMessage) {
     44    protected override bool Validate(string value, out string errorMessage) {
    4545      double val;
    4646      bool valid = double.TryParse(value, out val);
     
    5555      return valid;
    5656    }
    57     protected virtual string GetValue(int index) {
     57    protected override string GetValue(int index) {
    5858      return this[index].ToString("r");
    5959    }
    60     protected virtual bool SetValue(string value, int index) {
     60    protected override bool SetValue(string value, int index) {
    6161      double val;
    6262      if (double.TryParse(value, out val)) {
     
    6767      }
    6868    }
    69 
    70     #region IStringConvertibleArray Members
    71     int IStringConvertibleArray.Length {
    72       get { return Length; }
    73       set { Length = value; }
    74     }
    75     bool IStringConvertibleArray.Validate(string value, out string errorMessage) {
    76       return Validate(value, out errorMessage);
    77     }
    78     string IStringConvertibleArray.GetValue(int index) {
    79       return GetValue(index);
    80     }
    81     bool IStringConvertibleArray.SetValue(string value, int index) {
    82       return SetValue(value, index);
    83     }
    84     #endregion
    8569  }
    8670}
Note: See TracChangeset for help on using the changeset viewer.