int period, skip;
try {
period = Integer.parseInt((String) params.get("period"));
skip = Integer.parseInt((String) params.get("skip"));
} catch (RuntimeException ex) {
throw new DatasetProduceException("'period' and 'skip' parameters don't seem to have valid integer values");
}
if (dataset instanceof XYDataset) {
return MovingAverage.createMovingAverage((XYDataset)dataset, suffix, period, skip);
} else {
throw new DatasetProduceException("moving average only supported for XYDatasets");
}
}