Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 04:24:01 (14 years ago)
Author:
swagner
Message:

Refactored classes of HeuristicLab.Data and implemented encoding specific data classes (#909)

File:
1 edited

Legend:

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

    r3048 r3054  
    2828  [Creatable("Test")]
    2929  [StorableClass]
    30   public sealed class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray {
     30  public class BoolArray : ValueTypeArray<bool>, IStringConvertibleArray {
    3131    public BoolArray() : base() { }
    3232    public BoolArray(int length) : base(length) { }
    3333    public BoolArray(bool[] elements) : base(elements) { }
    34     private BoolArray(BoolArray elements) : base(elements) { }
    3534
    3635    public override IDeepCloneable Clone(Cloner cloner) {
    37       BoolArray clone = new BoolArray(this);
     36      BoolArray clone = new BoolArray(array);
    3837      cloner.RegisterClonedObject(this, clone);
    3938      return clone;
    4039    }
    4140
    42     #region IStringConvertibleArray Members
    43     int IStringConvertibleArray.Length {
    44       get { return Length; }
    45       set { Length = value; }
    46     }
    47 
    48     bool IStringConvertibleArray.Validate(string value, out string errorMessage) {
     41    protected virtual bool Validate(string value, out string errorMessage) {
    4942      bool val;
    5043      bool valid = bool.TryParse(value, out val);
     
    5952      return valid;
    6053    }
    61     string IStringConvertibleArray.GetValue(int index) {
     54    protected virtual string GetValue(int index) {
    6255      return this[index].ToString();
    6356    }
    64     bool IStringConvertibleArray.SetValue(string value, int index) {
     57    protected virtual bool SetValue(string value, int index) {
    6558      bool val;
    6659      if (bool.TryParse(value, out val)) {
     
    7164      }
    7265    }
     66
     67    #region IStringConvertibleArray Members
     68    int IStringConvertibleArray.Length {
     69      get { return Length; }
     70      set { Length = value; }
     71    }
     72    bool IStringConvertibleArray.Validate(string value, out string errorMessage) {
     73      return Validate(value, out errorMessage);
     74    }
     75    string IStringConvertibleArray.GetValue(int index) {
     76      return GetValue(index);
     77    }
     78    bool IStringConvertibleArray.SetValue(string value, int index) {
     79      return SetValue(value, index);
     80    }
    7381    #endregion
    7482  }
Note: See TracChangeset for help on using the changeset viewer.