- Timestamp:
- 07/18/17 14:19:29 (7 years ago)
- Location:
- branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/FilteredPreprocessingData.cs
r15110 r15269 28 28 29 29 namespace HeuristicLab.DataPreprocessing { 30 public class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData {30 public sealed class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData { 31 31 private readonly ITransactionalPreprocessingData originalData; 32 32 private ITransactionalPreprocessingData filteredData; … … 83 83 } 84 84 85 pr otectedFilteredPreprocessingData(FilteredPreprocessingData original, Cloner cloner)85 private FilteredPreprocessingData(FilteredPreprocessingData original, Cloner cloner) 86 86 : base(original, cloner) { 87 87 originalData = original.originalData; … … 90 90 public override IDeepCloneable Clone(Cloner cloner) { 91 91 return new FilteredPreprocessingData(this, cloner); 92 } 93 94 public bool IsCellEmpty(int columnIndex, int rowIndex) { 95 return ActiveData.IsCellEmpty(columnIndex, rowIndex); 92 96 } 93 97 -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/IPreprocessingData.cs
r15110 r15269 28 28 namespace HeuristicLab.DataPreprocessing { 29 29 public interface IPreprocessingData : INamedItem { 30 bool IsCellEmpty(int columnIndex, int rowIndex); 30 31 T GetCell<T>(int columnIndex, int rowIndex); 31 32 -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/PreprocessingData.cs
r15110 r15269 160 160 } 161 161 162 public static bool IsMissingValue(object value) { 163 if (value is double) return double.IsNaN((double)value); 164 if (value is string) return string.IsNullOrEmpty((string)value); 165 if (value is DateTime) return ((DateTime)value).Equals(DateTime.MinValue); 166 throw new ArgumentException(); 167 } 162 168 163 169 #region IPreprocessingData Members 170 public abstract bool IsCellEmpty(int columnIndex, int rowIndex); 164 171 public abstract T GetCell<T>(int columnIndex, int rowIndex); 165 172 … … 173 180 174 181 public abstract bool VariableHasType<T>(int columnIndex); 175 176 [Obsolete("use the index based variant, is faster")]177 public abstract IList<T> GetValues<T>(string variableName, bool considerSelection);178 182 179 183 public abstract IList<T> GetValues<T>(int columnIndex, bool considerSelection); -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/TransactionalPreprocessingData.cs
r15110 r15269 88 88 89 89 #region Overridden IPreprocessingData Members 90 public override bool IsCellEmpty(int columnIndex, int rowIndex) { 91 var value = variableValues[columnIndex][rowIndex]; 92 return IsMissingValue(value); 93 } 94 90 95 public override T GetCell<T>(int columnIndex, int rowIndex) { 91 96 return (T)variableValues[columnIndex][rowIndex]; … … 119 124 public override bool VariableHasType<T>(int columnIndex) { 120 125 return columnIndex >= variableValues.Count || variableValues[columnIndex] is List<T>; 121 }122 123 [Obsolete("use the index based variant, is faster")]124 public override IList<T> GetValues<T>(string variableName, bool considerSelection) {125 return GetValues<T>(GetColumnIndex(variableName), considerSelection);126 126 } 127 127
Note: See TracChangeset
for help on using the changeset viewer.