/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.metrapp.customalgorithms;
import java.util.LinkedList;
import org.metrapp.dataModel.DataFrame;
import org.metrapp.filters.Filter;
import org.metrapp.filters.FilterByTime;
import rcaller.RCaller;
import rcaller.RCode;
/**
*
* @author Ilija
*/
public class DateAlgorithmFactory implements AlgorithmFactory{
@Override
public void createRCodeVariableReductionAlgorithm() {
RCaller caller = new RCaller();
RCode code = new RCode();
code.addRCode(new DateReductor().returnRCodeVariableReduction());
caller.setRCode(code);
caller.runOnly();
}
@Override
public void createFilter(DataFrame d, RCaller caller, RCode code, LinkedList<String> parameters) {
//NOTE FilterByTime should be refactored to FilterByDate. Notify all commiters before change.
Filter f = new FilterByTime();
f.filterData(d, caller, code, parameters);
}
@Override
public void createRCodeStatAlgorithm() {
RCaller caller = new RCaller();
RCode code = new RCode();
code.addRCode(new AverageFunction().returnRCodeStatAlgorithm());
caller.setRCode(code);
caller.runOnly();
}
}