Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8256


Ignore:
Timestamp:
07/08/12 02:26:59 (12 years ago)
Author:
swagner
Message:

Additional minor refactoring of DataReducer (#1745)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/DataReducer.cs

    r8252 r8256  
    109109          break;
    110110        default:
    111           throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, typeof(IntValue)));
     111          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
    112112      }
    113113
     
    139139          break;
    140140        default:
    141           throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, typeof(IntValue)));
    142       }
    143     }
    144     #endregion
    145 
     141          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
     142      }
     143    }
     144    #endregion
    146145    #region double reduction
    147146    private void CalculateResult(IEnumerable<double> values, Type targetType) {
     
    170169          break;
    171170        default:
    172           throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, typeof(DoubleValue)));
     171          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
    173172      }
    174173
     
    200199          break;
    201200        default:
    202           throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, typeof(DoubleValue)));
    203       }
    204     }
    205     #endregion
    206 
     201          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
     202      }
     203    }
     204    #endregion
    207205    #region TimeSpan reduction
    208206    private void CalculateResult(IEnumerable<TimeSpan> values, Type targetType) {
     
    225223          break;
    226224        default:
    227           throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, typeof(TimeSpanValue)));
     225          throw new InvalidOperationException(string.Format("Operation {0} is not supported as ReductionOperation for type: {1}.", ReductionOperation.Value.Value, targetType));
    228226      }
    229227
     
    251249          break;
    252250        default:
    253           throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, typeof(TimeSpanValue)));
     251          throw new InvalidOperationException(string.Format("Operation {0} is not supported as TargetOperation for type: {1}.", TargetOperation.Value.Value, targetType));
    254252      }
    255253    }
Note: See TracChangeset for help on using the changeset viewer.