- Timestamp:
- 11/20/13 14:29:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r10145 r10146 35 35 public class Dataset : NamedItem, IDataset { 36 36 [StorableConstructor] 37 pr ivateDataset(bool deserializing) : base(deserializing) { }38 pr ivateDataset(Dataset original, Cloner cloner)37 protected Dataset(bool deserializing) : base(deserializing) { } 38 protected Dataset(Dataset original, Cloner cloner) 39 39 : base(original, cloner) { 40 40 variableValues = new Dictionary<string, IList>(original.variableValues); … … 143 143 144 144 [Storable(Name = "VariableValues")] 145 pr ivateDictionary<string, IList> variableValues;146 147 pr ivateList<string> variableNames;145 protected Dictionary<string, IList> variableValues; 146 147 protected List<string> variableNames; 148 148 [Storable] 149 149 public IEnumerable<string> VariableNames { … … 212 212 set { throw new NotSupportedException(); } 213 213 } 214 public bool ReadOnly {214 public virtual bool ReadOnly { 215 215 get { return false; } 216 216 } … … 228 228 return variableValues[variableNames[columnIndex]][rowIndex].ToString(); 229 229 } 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(); 244 232 } 245 233 public bool Validate(string value, out string errorMessage) {
Note: See TracChangeset
for help on using the changeset viewer.