Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/14 16:11:08 (11 years ago)
Author:
sbreuer
Message:
  • change function headers in manipulationlogic to interface datatypes
  • implemented find and replace logic
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs

    r10621 r10672  
    3030    private IStatisticsLogic statisticsLogic;
    3131    private ISearchLogic searchLogic;
    32 
    33     public ManipulationLogic(ITransactionalPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic) {
     32    private IDataGridLogic dataGridLogic;
     33
     34    public ManipulationLogic(ITransactionalPreprocessingData _prepocessingData, ISearchLogic theSearchLogic, IStatisticsLogic theStatisticsLogic, IDataGridLogic theDataGridLogic) {
    3435      preprocessingData = _prepocessingData;
    3536      searchLogic = theSearchLogic;
    3637      statisticsLogic = theStatisticsLogic;
     38      dataGridLogic = theDataGridLogic;
    3739    }
    3840
     
    4345    }
    4446
    45     public void ReplaceIndicesByAverageValue(Dictionary<int, List<int>> cells) {
     47    public void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells) {
    4648      preprocessingData.InTransaction(() => {
    4749        foreach (var column in cells) {
     
    5759    }
    5860
    59     public void ReplaceIndicesByMedianValue(Dictionary<int, List<int>> cells) {
     61    public void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells) {
    6062      preprocessingData.InTransaction(() => {
    6163        foreach (var column in cells) {
     
    7173    }
    7274
    73     public void ReplaceIndicesByRandomValue(Dictionary<int, List<int>> cells) {
     75    public void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells) {
    7476      preprocessingData.InTransaction(() => {
    7577        Random r = new Random();
     
    9799    }
    98100
    99     public void ReplaceIndicesByLinearInterpolationOfNeighbours(Dictionary<int, List<int>> cells) {
     101    public void ReplaceIndicesByLinearInterpolationOfNeighbours(IDictionary<int, IList<int>> cells) {
    100102      preprocessingData.InTransaction(() => {
    101103        foreach (var column in cells) {
     
    163165    }
    164166
    165     public void ReplaceIndicesByMostCommonValue(Dictionary<int, List<int>> cells) {
     167    public void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells) {
    166168      preprocessingData.InTransaction(() => {
    167169        foreach (var column in cells) {
     
    236238      }
    237239    }
     240
     241    public void ReplaceIndicesByValue(IDictionary<int, IList<int>> cells, string value) {
     242      preprocessingData.InTransaction(() => {
     243        foreach (var column in cells) {
     244          foreach (var rowIdx in column.Value) {
     245            dataGridLogic.SetValue(value, column.Key, rowIdx);
     246          }
     247        }
     248      });
     249    }
    238250  }
    239251}
Note: See TracChangeset for help on using the changeset viewer.