Package org.metrapp.customalgorithms

Source Code of org.metrapp.customalgorithms.DateAlgorithmFactory

/*
* 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();
    }
   
   
}
TOP

Related Classes of org.metrapp.customalgorithms.DateAlgorithmFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.