Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/14 16:06:44 (11 years ago)
Author:
tsteinre
Message:
  • started work on undo-feature of PreprocessingData
File:
1 edited

Legend:

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

    r10544 r10547  
    8787    #region IPreprocessingData Members
    8888
    89     [Obsolete("use the index based variant, is faster")]
    90     public T GetCell<T>(string variableName, int rowIndex) {
    91       return GetCell<T>(GetColumnIndex(variableName), rowIndex);
    92     }
    93 
    9489    public T GetCell<T>(int columnIndex, int rowIndex) {
    9590      return (T)variableValues[columnIndex][rowIndex];
    9691    }
    9792
    98     [Obsolete("use the index based variant, is faster")]
    99     public void SetCell<T>(string variableName, int rowIndex, T value) {
    100       SetCell<T>(GetColumnIndex(variableName), rowIndex, value);
    101     }
    102 
    103     public void SetCell<T>(int columnIndex, int rowIndex, T value) {
     93
     94    public void SetCell<T>(int columnIndex, int rowIndex, T value) {    // Undo-sensitive
    10495      variableValues[columnIndex][rowIndex] = value;
    10596      OnChanged(DataPreprocessingChangedEventType.ChangeItem, columnIndex, rowIndex);
    10697    }
    10798
    108     [Obsolete("use the index based variant, is faster")]
    109     public string GetCellAsString(string variableName, int rowIndex) {
    110       return GetCellAsString(GetColumnIndex(variableName), rowIndex);
    111     }
    11299
    113100    public string GetCellAsString(int columnIndex, int rowIndex) {
    114101      return variableValues[columnIndex][rowIndex].ToString();
    115102    }
     103
    116104
    117105    [Obsolete("use the index based variant, is faster")]
     
    124112    }
    125113
    126     [Obsolete("use the index based variant, is faster")]
    127     public void SetValues<T>(string variableName, IList<T> values) {
    128       SetValues<T>(GetColumnIndex(variableName), values);
    129     }
    130 
    131     public void SetValues<T>(int columnIndex, IList<T> values) {
     114    public void SetValues<T>(int columnIndex, IList<T> values) {    // Undo-sensitive
    132115      if (IsType<T>(columnIndex)) {
    133116        variableValues[columnIndex] = (IList)values;
     
    138121    }
    139122
    140     public void InsertRow(int rowIndex) {
     123    public void InsertRow(int rowIndex) {    // Undo-sensitive
    141124      foreach (IList column in variableValues.Values) {
    142125        Type type = column.GetType().GetGenericArguments()[0];
     
    146129    }
    147130
    148     public void DeleteRow(int rowIndex) {
     131    public void DeleteRow(int rowIndex) {    // Undo-sensitive
    149132      foreach (IList column in variableValues.Values) {
    150133        column.RemoveAt(rowIndex);
     
    153136    }
    154137
    155     public void InsertColumn<T>(string variableName, int columnIndex) {
     138    public void InsertColumn<T>(string variableName, int columnIndex) {    // Undo-sensitive
    156139      variableValues.Add(columnIndex, new List<T>(Rows));
    157       variableNames.Insert(columnIndex, variableName); 
    158       OnChanged(DataPreprocessingChangedEventType.AddColumn, columnIndex , -1);
    159     }
    160 
    161     public void DeleteColumn(int columnIndex) {
     140      variableNames.Insert(columnIndex, variableName);
     141      OnChanged(DataPreprocessingChangedEventType.AddColumn, columnIndex, -1);
     142    }
     143
     144    public void DeleteColumn(int columnIndex) {    // Undo-sensitive
    162145      variableValues.Remove(columnIndex);
    163146      variableNames.RemoveAt(columnIndex);
     
    165148    }
    166149
    167     [Obsolete("use the index based variant, is faster")]
    168     public void DeleteColumn(string variableName) {
    169       DeleteColumn(GetColumnIndex(variableName));
    170     }
    171150
    172151    public IntRange TrainingPartition {
     
    178157    }
    179158
     159    public string GetVariableName(int columnIndex) {
     160      return variableNames[columnIndex];
     161    }
     162
    180163    public IEnumerable<string> VariableNames {
    181164      get { return variableNames; }
    182165    }
    183166
    184     [Obsolete("use the index based variant, is faster")]
    185     public string GetVariableName(int columnIndex) {
    186       return variableNames[columnIndex];
    187     }
    188167    public int GetColumnIndex(string variableName) {
    189168      return variableNames.IndexOf(variableName);
    190169    }
    191170
    192     [Obsolete("use the index based variant, is faster")]
    193     public bool IsType<T>(string variableName) {
    194       return IsType<T>(GetColumnIndex(variableName));
    195 
    196     }
    197171    public bool IsType<T>(int columnIndex) {
    198172      return variableValues[columnIndex] is List<T>;
     
    224198    }
    225199
     200    public bool IsUndoAvailable {
     201      get { throw new NotImplementedException(); }
     202    }
     203
     204    public void Undo() {
     205      throw new NotImplementedException();
     206    }
     207
    226208    #endregion
    227209  }
Note: See TracChangeset for help on using the changeset viewer.