Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10146


Ignore:
Timestamp:
11/20/13 14:29:19 (11 years ago)
Author:
pfleck
Message:
  • implemented EditableDataset
  • made some Dataset components protected for EditableDataset
Location:
branches/DataPreprocessing
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj

    r10144 r10146  
    8484      <DependentUpon>DataPreprocessingView.cs</DependentUpon>
    8585    </Compile>
     86    <Compile Include="EditableDataset.cs" />
    8687    <Compile Include="Plugin.cs" />
    8788    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r10145 r10146  
    3535  public class Dataset : NamedItem, IDataset {
    3636    [StorableConstructor]
    37     private Dataset(bool deserializing) : base(deserializing) { }
    38     private Dataset(Dataset original, Cloner cloner)
     37    protected Dataset(bool deserializing) : base(deserializing) { }
     38    protected Dataset(Dataset original, Cloner cloner)
    3939      : base(original, cloner) {
    4040      variableValues = new Dictionary<string, IList>(original.variableValues);
     
    143143
    144144    [Storable(Name = "VariableValues")]
    145     private Dictionary<string, IList> variableValues;
    146 
    147     private List<string> variableNames;
     145    protected Dictionary<string, IList> variableValues;
     146
     147    protected List<string> variableNames;
    148148    [Storable]
    149149    public IEnumerable<string> VariableNames {
     
    212212      set { throw new NotSupportedException(); }
    213213    }
    214     public bool ReadOnly {
     214    public virtual bool ReadOnly {
    215215      get { return false; }
    216216    }
     
    228228      return variableValues[variableNames[columnIndex]][rowIndex].ToString();
    229229    }
    230     public bool SetValue(string value, int rowIndex, int columnIndex) {
    231       var values = variableValues[variableNames[columnIndex]];
    232       object insertValue = null;
    233       if (values is List<double>)
    234         insertValue = Double.Parse(value); /// TODO: set culture
    235       else if (values is List<string>)
    236         insertValue = value;
    237       else if (values is List<DateTime>)
    238         insertValue = DateTime.Parse(value);
    239       else
    240         throw new ArgumentException("The variable values must be of type double, string or DateTime");
    241 
    242       variableValues[variableNames[columnIndex]][rowIndex] = insertValue;
    243       return true;
     230    public virtual bool SetValue(string value, int rowIndex, int columnIndex) {
     231      throw new NotSupportedException();
    244232    }
    245233    public bool Validate(string value, out string errorMessage) {
Note: See TracChangeset for help on using the changeset viewer.