Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/17 14:19:29 (7 years ago)
Author:
pfleck
Message:

#2809: Removed SearchLogic

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  
    2828
    2929namespace HeuristicLab.DataPreprocessing {
    30   public class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData {
     30  public sealed class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData {
    3131    private readonly ITransactionalPreprocessingData originalData;
    3232    private ITransactionalPreprocessingData filteredData;
     
    8383    }
    8484
    85     protected FilteredPreprocessingData(FilteredPreprocessingData original, Cloner cloner)
     85    private FilteredPreprocessingData(FilteredPreprocessingData original, Cloner cloner)
    8686      : base(original, cloner) {
    8787      originalData = original.originalData;
     
    9090    public override IDeepCloneable Clone(Cloner cloner) {
    9191      return new FilteredPreprocessingData(this, cloner);
     92    }
     93
     94    public bool IsCellEmpty(int columnIndex, int rowIndex) {
     95      return ActiveData.IsCellEmpty(columnIndex, rowIndex);
    9296    }
    9397
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/IPreprocessingData.cs

    r15110 r15269  
    2828namespace HeuristicLab.DataPreprocessing {
    2929  public interface IPreprocessingData : INamedItem {
     30    bool IsCellEmpty(int columnIndex, int rowIndex);
    3031    T GetCell<T>(int columnIndex, int rowIndex);
    3132
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/PreprocessingData.cs

    r15110 r15269  
    160160    }
    161161
     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    }
    162168
    163169    #region IPreprocessingData Members
     170    public abstract bool IsCellEmpty(int columnIndex, int rowIndex);
    164171    public abstract T GetCell<T>(int columnIndex, int rowIndex);
    165172
     
    173180
    174181    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);
    178182
    179183    public abstract IList<T> GetValues<T>(int columnIndex, bool considerSelection);
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/TransactionalPreprocessingData.cs

    r15110 r15269  
    8888
    8989    #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
    9095    public override T GetCell<T>(int columnIndex, int rowIndex) {
    9196      return (T)variableValues[columnIndex][rowIndex];
     
    119124    public override bool VariableHasType<T>(int columnIndex) {
    120125      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);
    126126    }
    127127
Note: See TracChangeset for help on using the changeset viewer.